public function isOneDay() { return !$this->isOpen() && $this->start->toDate() == $this->end->toDate(); }
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; }