示例#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());
     }
 }
 /**
  * @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;
 }