Ejemplo n.º 1
0
 protected function makeRange($string)
 {
     if (strpos($string, ' - ') !== false) {
         list($first, $second) = explode(' - ', $string);
         return TimestampRange::create(new Timestamp(trim($first)), new Timestamp(trim($second)));
     }
     throw new WrongArgumentException();
 }
Ejemplo n.º 2
0
 /**
  * @return TimestampRange
  **/
 public function toTimestampRange()
 {
     return TimestampRange::create($this->getStart()->toTimestamp(), $this->getEnd()->toTimestamp());
 }