Fixes #6086 -- Prevent overnight scheduled items from playing again at the end of the last scheduled day.

This commit is contained in:
Buster Neece 2024-04-20 01:33:57 -05:00
parent c3e540eae7
commit a34d86f5c0
No known key found for this signature in database
1 changed files with 8 additions and 2 deletions

View File

@ -407,7 +407,10 @@ final class Scheduler
$startDate = CarbonImmutable::createFromFormat('Y-m-d', $startDate, $now->getTimezone());
if (null !== $startDate) {
$startDate = $startDate->setTime(0, 0);
$startDate = StationSchedule::getDateTime(
$schedule->getStartTime(),
$startDate
);
if ($now->lt($startDate)) {
return false;
}
@ -418,7 +421,10 @@ final class Scheduler
$endDate = CarbonImmutable::createFromFormat('Y-m-d', $endDate, $now->getTimezone());
if (null !== $endDate) {
$endDate = $endDate->setTime(23, 59, 59);
$endDate = StationSchedule::getDateTime(
$schedule->getEndTime(),
$endDate
);
if ($now->gt($endDate)) {
return false;
}