Esempio n. 1
0
 /**
  * Common method to render iCal events
  *
  * @access private
  * @param QueryBuilder $queryBuilder
  * @param iCalendar    $calendar
  */
 private function renderCalendar(QueryBuilder $queryBuilder, iCalendar $calendar)
 {
     $start = $this->request->getStringParam('start', strtotime('-2 month'));
     $end = $this->request->getStringParam('end', strtotime('+6 months'));
     $this->helper->ical->addTaskDateDueEvents($queryBuilder, $calendar, $start, $end);
     $formatter = new TaskICalFormatter($this->container);
     $this->response->ical($formatter->setCalendar($calendar)->format());
 }
Esempio n. 2
0
 /**
  * Get formatted calendar task due events
  *
  * @access public
  * @param  QueryBuilder  $queryBuilder
  * @param  iCalendar     $calendar
  * @param  string        $start
  * @param  string        $end
  */
 public function addTaskDateDueEvents(QueryBuilder $queryBuilder, iCalendar $calendar, $start, $end)
 {
     $queryBuilder->withFilter(new TaskDueDateRangeFilter(array($start, $end)));
     $formatter = new TaskICalFormatter($this->container);
     $formatter->setColumns('date_due');
     $formatter->setCalendar($calendar);
     $formatter->withQuery($queryBuilder->getQuery());
     $formatter->addFullDayEvents();
 }