Skip to content

Commit

Permalink
Default to 0 if start_time/end_time is null
Browse files Browse the repository at this point in the history
  • Loading branch information
webian committed May 21, 2022
1 parent 31ec3e3 commit 25e349e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Service/TimeTable/TimeTimeTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ protected function createNextLoopEntry(array $loopEntry, string $modification):
{
// Time modification
if (str_contains($modification, 'minutes') || str_contains($modification, 'hours')) {
$startTime = new \DateTime('@' . $loopEntry['start_time']);
$startTime = new \DateTime('@' . ($loopEntry['start_time'] ?? 0));
$startTime->modify($modification);
$loopEntry['start_time'] = $startTime->getTimestamp();

$endTime = new \DateTime('@' . $loopEntry['end_time']);
$endTime = new \DateTime('@' . ($loopEntry['end_time'] ?? 0));
$endTime->modify($modification);
$loopEntry['end_time'] = $endTime->getTimestamp();
} else {
Expand Down

0 comments on commit 25e349e

Please sign in to comment.