fixes #693: never select a default date before first existing shift in shifts view

main
msquare 5 years ago
parent 6fb6c9bc25
commit fbd78b8daf

@ -47,7 +47,12 @@ function update_ShiftsFilter_timerange(ShiftsFilter $shiftsFilter, $days)
{ {
$start_time = $shiftsFilter->getStartTime(); $start_time = $shiftsFilter->getStartTime();
if (is_null($start_time)) { if (is_null($start_time)) {
$start_time = time(); $first_day = DateTime::createFromFormat('Y-m-d', $days[0])->getTimestamp();
if(time() < $first_day) {
$start_time = $first_day;
} else {
$start_time = time();
}
} }
$end_time = $shiftsFilter->getEndTime(); $end_time = $shiftsFilter->getEndTime();

Loading…
Cancel
Save