public function getWeekSheetDays(\DateTime $date) { $first_day = DatesTransformer::toMonday($date); $last_day = DatesTransformer::toSunday($date); return DatesTransformer::getAllDaysBetween($first_day, $last_day); }
public function findAllByMonth(\DateTime $date) { $start = DatesTransformer::toFirstMonthDay($date)->setTime(0, 0); $end = DatesTransformer::toLastMonthDay($date)->setTime(23, 59); return $this->findAllByDates($start, $end); }
/** * @Template */ public function listByMonthAction($year, $month) { $day = new \DateTime("{$year}-{$month}-01"); $events = $this->getCalendar()->findAllByMonth($day); $collection = new EventCollection($events); return array('events' => $collection, 'dates' => $this->getCalendar()->getMonthSheetDays($day), 'current' => $day, 'next' => DatesTransformer::nextMonth($day), 'previous' => DatesTransformer::previousMonth($day)); }