From c1b623d25983e8cf8a3af784c2fd6c1251819895 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 25 Jan 2021 10:27:20 -0700 Subject: [PATCH] Calendar: Fix all day events were missing end date in iCal --- calendar/inc/class.calendar_ical.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index 4ff31b0fe0..bc091e4af0 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -608,7 +608,12 @@ class calendar_ical extends calendar_boupdate else { // write start + end of whole day events as dates - $event['end-nextday'] = $event['end'] + 12*3600; // we need the date of the next day, as DTEND is non-inclusive (= exclusive) in rfc2445 + if(!is_object($event['end'])) + { + $event['end'] = new Api\DateTime($event['end']); + } + $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);