예제 #1
0
 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;
 }
예제 #2
0
파일: Range.php 프로젝트: duncan3dc/dates
 /**
  * Create a new range object representing the current date.
  *
  * @return static
  */
 public static function now()
 {
     return new static(Date::now());
 }