Skip to main content
2 of 2
added 477 characters in body
Demerit
  • 24.7k
  • 2
  • 12
  • 34

On an older version you can use the prefs for activityDateTime. The code uses the same setting as for activityDateTime under Administer - Customize Data and Screens - Date Preferences. The line of code that creates the widget looks like this:

$this->addDateTime('start_date', ts('Start Date'), FALSE, array('formatType' => 'activityDateTime'));

which tells the form system to use the prefs for activityDateTime.

If you're on a more recent version of CiviCRM the widget has changed and there doesn't seem to be a pref. Temporarily you can edit the file CRM/Event/Form/ManageEvent/EventInfo.php and change the line that says this (around line 177)

$this->add('datepicker', 'start_date', ts('Start'), [], !$this->_isTemplate, ['time' => TRUE]);

to this:

$this->add('datepicker', 'start_date', ts('Start'), [], !$this->_isTemplate, ['time' => TRUE, 'yearRange' => '-50:+50']);

See also https://docs.civicrm.org/dev/en/latest/framework/ui/#date-picker

Demerit
  • 24.7k
  • 2
  • 12
  • 34