Improve handling of timespans
This commit is contained in:
parent
2a8ba31410
commit
6a91e31f41
@ -1030,8 +1030,9 @@ final class NodaTimeSplitter {
|
||||
|
||||
$middle_substraction = round($days_diff / 2);
|
||||
|
||||
$middle_day = date('Y-m-d',
|
||||
strtotime('+' . $middle_substraction . ' days', strtotime($startDate->format('Y-m-d'))));
|
||||
if (!($startDateTimestamp = strtotime($startDate->format('Y-m-d')))) return [];
|
||||
if (!($middleDayTimestamp = strtotime('+' . $middle_substraction . ' days', $startDateTimestamp))) return [];
|
||||
$middle_day = date('Y-m-d', $middleDayTimestamp);
|
||||
|
||||
$start_name = self::timePartsToTimeName($start);
|
||||
$end_name = self::timePartsToTimeName($end);
|
||||
|
Loading…
Reference in New Issue
Block a user