Ejemplo n.º 1
0
 public function findAllByMonthnNoUser(\DateTime $date)
 {
     $start = DatesTransformer::toFirstMonthDay($date)->setTime(0, 0);
     $end = DatesTransformer::toLastMonthDay($date)->setTime(23, 59);
     return $this->findAllByDates($start, $end);
 }
Ejemplo n.º 2
0
 public function getWeekSheetDays(\DateTime $date)
 {
     $first_day = DatesTransformer::toMonday($date);
     $last_day = DatesTransformer::toSunday($date);
     return DatesTransformer::getAllDaysBetween($first_day, $last_day);
 }
 /**
  * @test
  */
 public function itBringsThePreviousDay()
 {
     // Arrange
     $reference_date = new \DateTime('2013-05-01');
     // Act
     $previous_day = DatesTransformer::previousDay($reference_date);
     // Assert
     $this->assertEquals('2013-04-30', $previous_day->format('Y-m-d'));
 }
 /**
  * @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));
 }
Ejemplo n.º 5
0
 public function listByUserAction($year, $month, $user)
 {
     $day = new \DateTime("{$year}-{$month}-01");
     $events = $this->getDoctrine()->getRepository('PortailCalendarBundle:Event')->findAllByMonth($user, $day);
     $collection = new EventCollection($events);
     return $this->render('PortailRendezvousBundle::listByUser.html.twig', array('events' => $collection, 'dates' => $this->getCalendar()->getMonthSheetDays($day), 'current' => $day, 'next' => DatesTransformer::nextMonth($day), 'previous' => DatesTransformer::previousMonth($day)));
 }