Beispiel #1
0
 public static function stringToTimeList($string)
 {
     $list = [];
     $times = split("([,; \n]+)", $string);
     for ($i = 0, $size = count($times); $i < $size; ++$i) {
         $time = mb_ereg_replace('[^0-9:]', ':', $times[$i]);
         try {
             $list[] = Time::create($time);
         } catch (WrongArgumentException $e) {
             /* ignore */
         }
     }
     return $list;
 }
Beispiel #2
0
 private function checkLimits(Time $time)
 {
     return !($this->min && $this->min->toSeconds() > $time->toSeconds()) && !($this->max && $this->max->toSeconds() < $time->toSeconds());
 }