diff --git a/code/Calendar.php b/code/Calendar.php index 801d326..0f9ab27 100755 --- a/code/Calendar.php +++ b/code/Calendar.php @@ -173,10 +173,8 @@ public function getDateToEventRelation() { public function getEventList($start, $end, $filter = null, $limit = null, $announcement_filter = null) { - + $eventList = new ArrayList(); foreach($this->getAllCalendars() as $calendar) { - - $eventList = new ArrayList(); if($events = $calendar->getStandardEvents($start, $end, $filter)) { $eventList->merge($events); } @@ -204,11 +202,9 @@ public function getEventList($start, $end, $filter = null, $limit = null, $annou } - $eventList->sort(array("StartDate" => "ASC", "StartTime" => "ASC")); - - // if($this->Feeds()) { - // $event_list = $this->importFromFeeds($event_list); - // } + + $eventList = $eventList->sort(array("StartDate" => "ASC", "StartTime" => "ASC")); + $eventList = $eventList->limit($limit); return $eventList; }