Fixes #824: Server error when no shifts configured and with 'user_shifts' as home site
This commit is contained in:
parent
ac9aa2169a
commit
a68c8ae6d2
|
@ -49,7 +49,10 @@ function update_ShiftsFilter_timerange(ShiftsFilter $shiftsFilter, $days)
|
|||
{
|
||||
$start_time = $shiftsFilter->getStartTime();
|
||||
if (is_null($start_time)) {
|
||||
$first_day = DateTime::createFromFormat('Y-m-d', $days[0])->getTimestamp();
|
||||
$first_day = DateTime::createFromFormat(
|
||||
'Y-m-d',
|
||||
$days[0] ?? (new DateTime())->format('Y-m-d')
|
||||
)->getTimestamp();
|
||||
if(time() < $first_day) {
|
||||
$start_time = $first_day;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue