Example #1
0
 /**
  * find Week
  *
  * @param int $year
  * @param int $week
  *
  * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
  */
 public function findWeek($year, $week)
 {
     $firstDay = DateTimeUtility::convertWeekYear2DayMonthYear($week, $year);
     $timeStampStart = $firstDay->getTimestamp();
     return $this->findByTimeSlot($timeStampStart, $timeStampStart + DateTimeUtility::SECONDS_WEEK - 1);
 }
 /**
  * Week action
  *
  * @param int $year
  * @param int $week
  *
  * @return void
  */
 public function weekAction($year = null, $week = null)
 {
     if ($year === null) {
         $year = date('Y');
     }
     if ($week === null) {
         $week = date('W');
     }
     $firstDay = DateTimeUtility::convertWeekYear2DayMonthYear($week, $year);
     $firstDay->setTime(0, 0, 0);
     $this->slotExtendedAssignMultiple(['firstDay' => $firstDay, 'indices' => $this->indexRepository->findWeek($year, $week)], __CLASS__, __FUNCTION__);
 }
 /**
  * Week action
  *
  * @param int $year
  * @param int $week
  *
  * @return void
  */
 public function weekAction($year = NULL, $week = NULL)
 {
     if ($year === NULL) {
         $year = date('Y');
     }
     if ($week === NULL) {
         $week = date('W');
     }
     $firstDay = DateTimeUtility::convertWeekYear2DayMonthYear($week, $year);
     $firstDay->setTime(0, 0, 0);
     $this->view->assignMultiple(array('firstDay' => $firstDay, 'indices' => $this->indexRepository->findWeek($year, $week)));
 }
Example #4
0
 /**
  * find Week
  *
  * @param int $year
  * @param int $week
  *
  * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
  */
 public function findWeek($year, $week)
 {
     $query = $this->createQuery();
     $constraints = $this->getDefaultConstraints($query);
     $firstDay = DateTimeUtility::convertWeekYear2DayMonthYear($week, $year);
     $timeStampStart = $firstDay->getTimestamp();
     $firstDay->modify('+1 week');
     $timeStampEnd = $firstDay->getTimestamp();
     $this->addTimeFrameConstraints($constraints, $query, $timeStampStart, $timeStampEnd);
     $query->matching($query->logicalAnd($constraints));
     return $query->execute();
 }