Пример #1
0
 public function isOneDay()
 {
     return !$this->isOpen() && $this->start->toDate() == $this->end->toDate();
 }
Пример #2
0
 public static function getHumanDay(Date $date, $wordDayNeed = true)
 {
     $today = Date::makeToday();
     $tomorrow = $today->spawn('+1 day');
     if ($date->toDate() == $today->toDate() && $wordDayNeed == true) {
         return 'сегодня';
     } elseif ($date->toDate() == $tomorrow->toDate() && $wordDayNeed == true) {
         return 'завтра';
     } else {
         return (int) $date->getDay() . ' ' . RussianTextUtils::getMonthInGenitiveCase($date->getMonth());
     }
 }
Пример #3
0
 /**
  * @throws WrongArgumentException
  * @return CalendarMonthWeekly
  **/
 public function setSelected(Date $day)
 {
     if (!isset($this->days[$day->toDate()])) {
         throw new WrongArgumentException($day->toDate() . ' not in calendar');
     }
     $this->days[$day->toDate()]->setSelected(true);
     return $this;
 }