From 5a337892668e22a376a7e65d7818cc78f23a7bd1 Mon Sep 17 00:00:00 2001 From: Ian Date: Thu, 25 May 2017 16:18:34 +1200 Subject: [PATCH 1/2] Fix issue with monthly preview not showing all events The monthly preview calendar works by doing an ajax request for all events in each month. This was limiting to 20 events by default, due to pagination. This meant that where there were more than 20 events in a month, days after the 20th weren't being marked as having an event. --- code/Calendar.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/Calendar.php b/code/Calendar.php index ba71493..90031f7 100755 --- a/code/Calendar.php +++ b/code/Calendar.php @@ -663,6 +663,10 @@ public function rss() { public function monthjson(SS_HTTPRequest $r) { if(!$r->param('ID')) return false; + + //Increase the per page limit to 500 as the AJAX request won't look for further pages + $this->EventsPerPage = 500; + $this->startDate = sfDate::getInstance(CalendarUtil::get_date_from_string($r->param('ID'))); $this->endDate = sfDate::getInstance($this->startDate)->finalDayOfMonth(); From 56c5ac5cb361fd374ff27eeb8a2f36c9948cc1c7 Mon Sep 17 00:00:00 2001 From: Ian Date: Thu, 25 May 2017 16:21:08 +1200 Subject: [PATCH 2/2] 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