From f039723e3993f6b8c8d32924b06bcf8fafccd9f3 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 14 Nov 2023 09:55:06 -0700 Subject: [PATCH] Calendar: Change iCal export use to use event timezone. Fixes whole day events grow to next day --- calendar/inc/class.calendar_ical.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index ae8d4ea05c..8daa82ed3e 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -610,13 +610,13 @@ class calendar_ical extends calendar_boupdate // write start + end of whole day events as dates if(!is_object($event['end'])) { - $event['end'] = new Api\DateTime($event['end']); + $event['end'] = new Api\DateTime($event['end'], self::$tz_cache[$event['tzid']]); } $event['end-nextday'] = clone $event['end']; $event['end-nextday']->add("1 day"); // we need the date of the next day, as DTEND is non-inclusive (= exclusive) in rfc2445 foreach (array('start' => 'DTSTART','end-nextday' => 'DTEND') as $f => $t) { - $time = new Api\DateTime($event[$f],Api\DateTime::$server_timezone); + $time = new Api\DateTime($event[$f], self::$tz_cache[$event['tzid']]); $arr = Api\DateTime::to($time,'array'); $vevent->setAttribute($t, array('year' => $arr['year'],'month' => $arr['month'],'mday' => $arr['day']), array('VALUE' => 'DATE'));