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 ♦Commented Jan 8, 2019 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 SimonisCommented Jan 9, 2019 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 ♦Commented Jan 13, 2019 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 SimonisCommented Jan 14, 2019 at 4:24
-
1I 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 ♦Commented Jan 14, 2019 at 4:46
3 Answers
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 –
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 –
-
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. Commented Jan 9, 2019 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. Commented Jan 24, 2019 at 11:58
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)
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. Commented Jan 8, 2019 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...– DemeritCommented Jan 8, 2019 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.– DemeritCommented Jan 8, 2019 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. Commented Jan 9, 2019 at 13:34