Skip to content

Commit

Permalink
Fix Announcement Filtering
Browse files Browse the repository at this point in the history
Changes to Announcement filters in getAnnouncementClass() and
UpcomingAnnouncements()
  • Loading branch information
cmcramer committed Jun 24, 2014
1 parent b165430 commit 1d8b49a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions code/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1d8b49a

Please sign in to comment.