@@ 340-358 (lines=19) @@ | ||
337 | return end($list) ?: false; |
|
338 | } |
|
339 | ||
340 | public function currentOpenRangeStart(DateTimeInterface $dateTime) |
|
341 | { |
|
342 | /** @var TimeRange $range */ |
|
343 | $range = $this->currentOpenRange($dateTime); |
|
344 | ||
345 | if (! $range) { |
|
346 | return false; |
|
347 | } |
|
348 | ||
349 | $dateTime = $this->copyDateTime($dateTime); |
|
350 | ||
351 | $nextDateTime = $range->start()->toDateTime(); |
|
352 | ||
353 | if ($range->overflowsNextDay() && $nextDateTime->format('Hi') > $dateTime->format('Hi')) { |
|
354 | $dateTime = $dateTime->modify('-1 day'); |
|
355 | } |
|
356 | ||
357 | return $dateTime->setTime($nextDateTime->format('G'), $nextDateTime->format('i'), 0); |
|
358 | } |
|
359 | ||
360 | public function currentOpenRangeEnd(DateTimeInterface $dateTime) |
|
361 | { |
|
@@ 360-378 (lines=19) @@ | ||
357 | return $dateTime->setTime($nextDateTime->format('G'), $nextDateTime->format('i'), 0); |
|
358 | } |
|
359 | ||
360 | public function currentOpenRangeEnd(DateTimeInterface $dateTime) |
|
361 | { |
|
362 | /** @var TimeRange $range */ |
|
363 | $range = $this->currentOpenRange($dateTime); |
|
364 | ||
365 | if (! $range) { |
|
366 | return false; |
|
367 | } |
|
368 | ||
369 | $dateTime = $this->copyDateTime($dateTime); |
|
370 | ||
371 | $nextDateTime = $range->end()->toDateTime(); |
|
372 | ||
373 | if ($range->overflowsNextDay() && $nextDateTime->format('Hi') < $dateTime->format('Hi')) { |
|
374 | $dateTime = $dateTime->modify('+1 day'); |
|
375 | } |
|
376 | ||
377 | return $dateTime->setTime($nextDateTime->format('G'), $nextDateTime->format('i'), 0); |
|
378 | } |
|
379 | ||
380 | public function nextOpen(DateTimeInterface $dateTime): DateTimeInterface |
|
381 | { |