Shifts overview: Added filter_max_duration to limit max runtime
This commit is contained in:
parent
8f2da56892
commit
537179df66
|
@ -167,6 +167,10 @@ return [
|
|||
'4XL' => '4XLarge Straight-Cut',
|
||||
],
|
||||
|
||||
// Shifts overview
|
||||
// Set max number of hours that can be shown at once
|
||||
'filter_max_duration' => 0,
|
||||
|
||||
// Session config
|
||||
'session' => [
|
||||
// Supported: pdo or native
|
||||
|
|
|
@ -119,6 +119,11 @@ class ShiftsFilter
|
|||
*/
|
||||
public function setEndTime($endTime)
|
||||
{
|
||||
$filterMaxDuration = config('filter_max_duration') * 60 * 60;
|
||||
if ($filterMaxDuration && ($endTime - $this->startTime > $filterMaxDuration)) {
|
||||
$endTime = $this->startTime + $filterMaxDuration;
|
||||
}
|
||||
|
||||
$this->endTime = $endTime;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue