From 5864368386bfdaae892f871389461f80ee278c31 Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 28 Apr 2020 10:47:38 -0600 Subject: [PATCH] Calendar: Fix wrong EXDATE values Current iCal export always puts exdates into UTC. Now pre-adjusting the dates to counteract that. --- calendar/inc/class.calendar_ical.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index e93ec6dc8a..a7a2ec1782 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -672,10 +672,11 @@ class calendar_ical extends calendar_boupdate { foreach ($event['recur_exception'] as $key => $timestamp) { - // current Horde_Icalendar 2.1.4 exports EXDATE always postfixed with a Z :( + // current Horde_Icalendar 2.1.4 exports EXDATE always in UTC, postfixed with a Z :( // so if we set a timezone here, we have to remove the Z, see the hack at the end of this method // Apple calendar on OS X 10.11.4 uses a timezone, so does Horde eg. for Recurrence-ID - $event['recur_exception'][$key] = self::getDateTime($timestamp, $tzid, $parameters['EXDATE']); + $ex_date = new Api\DateTime($timestamp, Api\DateTime::$server_timezone); + $event['recur_exception'][$key] = self::getDateTime($ex_date->format('ts') + $ex_date->getOffset(), $tzid, $parameters['EXDATE']); } } else