Beispiel #1
0
 /**
  * @param  DateTime|null $start
  * @return DateTime
  */
 public function toDateTime(DateTime $start = null)
 {
     $start = $this->getNewStartDate($start);
     $end = parent::toDateTime($start);
     if ($this->holidays) {
         $span = new DateTimeSpan($start, $end);
         $span = $this->holidays->extendDateTimeSpan($span);
         return $span->getTo();
     }
     return $end;
 }
Beispiel #2
0
 /**
  * @covers ::toDateTime
  * @dataProvider dataToDateTime
  */
 public function testToDateTime($input, $start, $result)
 {
     $days = new WeekDays($input);
     $this->assertEquals($result->format('d m Y'), $days->toDateTime($start)->format('d m Y'));
 }