5

We're importing participant data from all our old events. However, I've run into the issue that it only allows me to pick dates back to 1999 when creating the old events. I need to go back as far as 1970. Where do I go to change that setting? I found it for activities and such, but nothing that has affected the listing for events.

  • when you say 'importing' do you meaning using the Import Wizard or doing this manually (since you say 'pick') – petednz - fuzion Jan 8 at 18:44
  • Picking a date is with regards to actually creating the event in CiviEvent so that we have something to import the participants to. – Jenni Simonis Jan 9 at 13:31
  • So is it the Event Date or the Registration Date you are asking about? ie i am unclear which 'it' the "it only allows" refers to. – petednz - fuzion Jan 13 at 22:59
  • Yes, the event date when we are creating an event in CiviEvent. But it's already been answered below - I can manually enter a date that goes back further than the pop-up date calendar. – Jenni Simonis Jan 14 at 4:24
  • 1
    I was being confused by fact the Answer had screenshots pertaining to Participant Registration - i added an Answer focussed on New Event in case that helps others. – petednz - fuzion Jan 14 at 4:46
4
+50

As you have discovered Jenni, changing any of the start offset and end offset values in the date preferences settings do not reflect participant and event dates.

/civicrm/admin/setting/preferences/date?reset=1

So unfortunately, there is no option to make these amendments via the UI.

However, CiviCRM does allow you to manually input dates/years well before 1999/2009 which are accepted, and the records do get saved without an error –

enter image description here

enter image description here

The same method also works when importing participants.

This is a sample CSV I’ve used which had a registered date of 1966 which imported successfully –

enter image description here

enter image description here

enter image description here

  • Thanks. This is what I'll do, then. I didn't realize it would save them without issue even though it was outside the time frame. I'll just manually input the ones that I still have left that are older than 20 years. – Jenni Simonis Jan 9 at 13:32
  • Well, darned it. I just tried manually adding a date for a training in 1978 and it tells me it needs a date after 1999. It automatically changes the date to 1999 if I manually input anything previous to that. I guess I am going to just have to use the API for now to import them even when it's just a couple events. – Jenni Simonis Jan 24 at 11:58
2

When you are creating an Event, the date picker may only offer dates back a certain way (per the purple rectangle in the screenshot), but you can manually enter the dates in the form specified in your Date Settings at civicrm/admin/setting/date?reset=1, eg mm/dd/yyyy (per the green rectangle in the screenshot)

enter image description here

0

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

  • I changed them there and none appeared to change the dates available for an event. I guess I'll try again, but the other day when I tried, nothing went back further than 20 even though I tried changing every one of them. – Jenni Simonis Jan 8 at 4:44
  • Actually I was just noticing it might depend what version you're on. Later versions might be slightly different. Give me a couple minutes... – Demerit Jan 8 at 4:49
  • I've updated answer. It's interesting you mentioned 1999 because that's the default for the older version, but the default on the newer version is 2009. Anyway, one of the solutions should work. – Demerit Jan 8 at 5:33
  • We're still running 4.7 during this process of bringing over all the data. We didn't want to do a big version change and moving over data at the same time, since that's just a recipe for disaster. And the importing of data couldn't wait. Once I'm done with all this, the next big task is a huge Civi upgrade. – Jenni Simonis Jan 9 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.