From bd8dd18b127aadc1d3f38968a27ffb8687f93bf0 Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 9 Jun 2017 15:28:06 -0600 Subject: [PATCH] Calendar - Fix 1 day holidays with duration specified as P1D spanning 2 days --- calendar/inc/class.calendar_ical.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index 1d7f6c5552..78ca6b75d7 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -2417,6 +2417,13 @@ class calendar_ical extends calendar_boupdate // No reference or RECURRENCE-ID for the series master $event['reference'] = $event['recurrence'] = 0; } + if (Api\DateTime::to($event['start'], 'H:i:s') == '00:00:00' && Api\DateTime::to($event['end'], 'H:i:s') == '00:00:00' + && $event['end'] - $event['start'] == 86400 + ) + { + // 'All day' event that ends at midnight the next day, avoid that + $event['end']--; + } // handle the alarms $alarms = $event['alarm'];