From b165430e669fd06200345d1d0b896398fc2c3acb Mon Sep 17 00:00:00 2001 From: Cathy Camer Date: Tue, 24 Jun 2014 15:38:39 -0600 Subject: [PATCH 1/2] Create README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..425f206 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +silverstripe-event-calendar +=========================== + +The Event Calendar module for SilverStripe + +Fixes for Announcements not filtering correctly From 1d8b49a2827f5c4198892c2e549b78f74d1cb508 Mon Sep 17 00:00:00 2001 From: Cathy Cramer Date: Tue, 24 Jun 2014 15:45:09 -0600 Subject: [PATCH 2/2] Fix Announcement Filtering Changes to Announcement filters in getAnnouncementClass() and UpcomingAnnouncements() --- code/Calendar.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/code/Calendar.php b/code/Calendar.php index ff016c3..5b8db68 100755 --- a/code/Calendar.php +++ b/code/Calendar.php @@ -179,11 +179,9 @@ public function getEventList($start, $end, $filter = null, $limit = null, $annou $announcements = DataList::create($this->getAnnouncementClass()) ->filter(array( - "CalendarID" => $calendar->ID - )) - ->exclude(array( - "StartDate:LessThan" => $start, - "EndDate:GreaterThan" => $end, + "CalendarID" => $calendar->ID, + "StartDate:LessThan:Not" => $start, + "EndDate:GreaterThan:Not" => $end, )); if($announcement_filter) { $announcements = $announcements->where($announcement_filter); @@ -411,7 +409,7 @@ public function UpcomingEvents($limit = 5, $filter = null) { public function UpcomingAnnouncements($limit = 5, $filter = null) { return $this->Announcements() ->filter(array( - 'StartDate:GreaterThan' => 'DATE(NOW())' + 'StartDate:GreaterThan' => 'NOW' )) ->where($filter) ->limit($limit);