protected function bhChristmasDays() { # If it's not December then it's not a bh if ($this->numeric("m") !== 12) { return false; } # Move the christmas day bh if it's a weekend $christmas = Date::mkdate($this->numeric("Y"), 12, 25); while ($christmas->isWeekend()) { $christmas = $christmas->addDays(1); } if ($this->string("Ymd") === $christmas->string("Ymd")) { return true; } # Move the boxing day bh if it's a weekend $boxing = $christmas->addDays(1); while ($boxing->isWeekend()) { $boxing = $boxing->addDays(1); } if ($this->string("Ymd") === $boxing->string("Ymd")) { return true; } return false; }
/** * Create a new range object representing the current date. * * @return static */ public static function now() { return new static(Date::now()); }