public function getNextRecurringEvents($event_obj, $datetime_obj, $limit = null) { $counter = new sfDate($datetime_obj->StartDate); if ($event = $datetime_obj->Event()->DateTimes()->First()) { $end_date = strtotime($event->EndDate); } else { $end_date = false; } $counter->tomorrow(); $dates = new DataObjectSet(); while ($dates->Count() != $this->OtherDatesCount) { // check the end date if ($end_date) { if ($end_date > 0 && $end_date <= $counter->get()) { break; } } if ($event_obj->recursionHappensOn($counter->get())) { $dates->push($this->newRecursionDateTime($datetime_obj, $counter->date())); } $counter->tomorrow(); } return $dates; }
protected function MicroformatEnd($offset = true) { if ($this->AllDay() && $this->StartDate) { $time = "00:00:00"; $end = new sfDate($this->StartDate); $date = $end->tomorrow()->date(); unset($end); } else { $date = $this->EndDate ? $this->EndDate : $this->StartDate; $time = $this->EndTime && $this->StartTime ? $this->EndTime : (!$this->EndTime && $this->StartTime ? $this->StartTime : "00:00:00"); } return CalendarUtil::Microformat($date, $time, $offset); }