Skip to content

Commit

Permalink
Merge pull request #51 from LiamW/patch-2
Browse files Browse the repository at this point in the history
Update CalendarEvent.php
  • Loading branch information
unclecheese committed May 21, 2014
2 parents e9d2842 + a969aaa commit e336d06
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions code/CalendarEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,24 +170,25 @@ public function OtherDates() {
elseif(strtotime($_REQUEST['date']) > 0) {
$date = date('Y-m-d', strtotime($_REQUEST['date']));
$cal = $this->Parent();
if($this->Recursion == 1) {
$datetime_obj = DataList::create($this->data()->getDateTimeClass())
->where("EventID = {$this->ID}")
->first();
$datetime_obj->StartDate = $date;
return $cal->getNextRecurringEvents($this, $datetime_obj);
}
else {
return DataList::create($this->data()->getDateTimeClass())
->filter(array(
"EventID" => $this->ID
))
->exclude(array(
"StartDate" => $date
))
->sort("StartDate ASC")
->limit($cal->OtherDatesCount);
}
}

if($this->Recursion == 1) {
$datetime_obj = DataList::create($this->data()->getDateTimeClass())
->where("EventID = {$this->ID}")
->first();
$datetime_obj->StartDate = $date;
return $cal->getNextRecurringEvents($this, $datetime_obj);
}
else {
return DataList::create($this->data()->getDateTimeClass())
->filter(array(
"EventID" => $this->ID
))
->exclude(array(
"StartDate" => $date
))
->sort("StartDate ASC")
->limit($cal->OtherDatesCount);
}
return false;
}
Expand Down

0 comments on commit e336d06

Please sign in to comment.