We have been using a script we wrote for a calendar that aggregates multiple calendar feeds into one. There are multiple time zones.
With the recent updates to the script, we modified the script and it is working fine in list view. The main calendar view, though, is still pulling the incorrect times. This can be seen on http://www.arts-spark.com/calendar.
When I debug, it is definitely doing the time zone conversion, but the full calendar view does not seem to be picking up the add_filter( ‘eventorganiser_get_the_start’, ‘my_callback_function’, 10, 5 );
Is there something different with the full calendar view now?
Thanks!
Beth

Beth Moeller
Beth,
Could you remind me what you’re doing again? If I recall correctly you have multiple sources with different timezones, and you want those pulled in and displayed on the site with the timezone ‘remembered’.
For the calendar, then, are you trying to display each event in its own ‘local’ timezone?
Regarding the question, it seems that the appropriate function is not called for fullcalendar – which means your code to modify the timezone does not take effect.
But you can use the eventorganiser_fullcalendar_event
to catch it later (there’s a similar hook for the admin calendar):
add_filter( 'eventorganiser_fullcalendar_event', 'my_correct_event_times', 10, 3 );
add_filter( 'eventorganiser_admin_fullcalendar_event', 'my_correct_event_times', 10, 3 );
function my_correct_event_times( $event, $event_id, $occurrence_id ) {
$event['start'] = eo_get_the_start( 'Y-m-d\TH:i:s', $event_id, $occurrence_id );
$event['end'] = eo_get_the_end( 'Y-m-d\TH:i:s', $event_id, $occurrence_id );
return $event;
};
The above is untested, but should, in principle, work.
Please note, though, that these calendars are cached, so any changes might not be reflected immediately. You can clear the cache by updating an event.

Stephen Harris
Hi Stephen,
Correct, we are aggregating calendars from multiple time zones and want the event time displayed in the local time zone for the venue (i.e. a 6:30pm event on the West US Coast should show as 6:30pm, not the East Coast time of 9:30pm).
We have a separate data table that tracks the timezone for each event category–created manually. We had been getting the feed id from post_meta and then getting category id once we had feed id. Since that information is no longer in post_meta, we had to go a different route. That is resolved now.
This is the code that actually does the conversion, once we know the time zone (variable $tz).
$currentzone = new DateTimeZone('America/New_York');
$displayzone = new DateTimeZone ($tz);
$formstart = $start->format('Y-m-d H:i:s');
$newstart = new DateTime($formstart, $currentzone);
$newstart->setTimezone($displayzone);<br />
$start = $newstart;
$displaynewstart = $newstart->format('Y-m-d H:i:s');
return eo_format_datetime($start,$format);
If I use your filters above, it looks like I just need to modify what is returned into an array that the full calendar can handle. Will that cause a problem for what we’re using on the sidebar–should I do this as separate functions?
Beth

Beth Moeller
The above filters will only affect the admin/front-end calendar, but where are you doing the timezone conversion? I thought it was on a hook that filters the returned value from eo_get_the_start()
(but I could be wrong).
But if not, then yes you’d need to do the conversions on in that callback.
We had been getting the feed id from post_meta and then getting category id once we had feed id. Since that information is no longer in post_meta, we had to go a different route
The feed I should still be stored in post meta (with key _eventorganiser_feed
)

Stephen Harris
I should add that you might want to clone the DateTime
object if you going to modify it.

Stephen Harris