1 | <?php |
||
14 | class DateTimeSpan |
||
15 | { |
||
16 | /** |
||
17 | * @var DateTime |
||
18 | */ |
||
19 | private $from; |
||
20 | |||
21 | /** |
||
22 | * @var DateTime |
||
23 | */ |
||
24 | private $to; |
||
25 | |||
26 | 1 | public function __construct(DateTime $from, DateTime $to) |
|
31 | |||
32 | /** |
||
33 | * @return DateTime |
||
34 | */ |
||
35 | 1 | public function getFrom() |
|
39 | |||
40 | /** |
||
41 | * @return DateTime |
||
42 | */ |
||
43 | 1 | public function getTo() |
|
47 | |||
48 | /** |
||
49 | * @param DateTime $datetime |
||
50 | * |
||
51 | * @return bool |
||
52 | */ |
||
53 | 3 | public function contains(DateTime $datetime) |
|
57 | |||
58 | /** |
||
59 | * @return string |
||
60 | */ |
||
61 | 4 | public function humanize() |
|
80 | |||
81 | 6 | public function getBusinessDaysInPeriodFrom(DateTime $startDate = null): int |
|
89 | |||
90 | public function getBusinessDaysInPeriodTo(DateTime $startDate = null): int |
||
98 | |||
99 | 12 | private function calculateBusinessDaysInPeriod(DateTime $startDate, DateTime $endDate): int |
|
112 | } |
||
113 |