Skip to content

Commit

Permalink
Fix issue with daily event lists from ICS feed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
IanSimpson authored May 25, 2017
1 parent a3fb6ad commit 56c5ac5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 56c5ac5

Please sign in to comment.