From 56c5ac5cb361fd374ff27eeb8a2f36c9948cc1c7 Mon Sep 17 00:00:00 2001 From: Ian Date: Thu, 25 May 2017 16:21:08 +1200 Subject: [PATCH] Fix issue with daily event lists from ICS feed When events were being fed from an ICS file, the daily list wasn't work, as the comparison was searching for events between midnight and midnight on a specific day. This meant that events that didn't occur at midnight never showed up. --- code/Calendar.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/Calendar.php b/code/Calendar.php index 90031f7..75c38a4 100755 --- a/code/Calendar.php +++ b/code/Calendar.php @@ -371,6 +371,11 @@ public function getFeedEvents($start_date, $end_date) { } $startdatetime = $this->iCalDateToDateTime($event['DTSTART']);//->setTimezone(new DateTimeZone($this->stat('timezone'))); $enddatetime = $this->iCalDateToDateTime($event['DTEND']);//->setTimezone(new DateTimeZone($this->stat('timezone'))); + + //Set event start/end to midnight to allow comparisons below to work + $startdatetime->modify('00:00:00'); + $enddatetime->modify('00:00:00'); + if ( ($startdatetime < $start && $enddatetime < $start) || $startdatetime > $end && $enddatetime > $end) { // do nothing; dates outside range