diff --git a/includes/model/ShiftsFilter.php b/includes/model/ShiftsFilter.php index 044b32dd..ff1f5d40 100644 --- a/includes/model/ShiftsFilter.php +++ b/includes/model/ShiftsFilter.php @@ -9,6 +9,12 @@ namespace Engelsystem; */ class ShiftsFilter { + /** + * How long can the time interval be? + */ + const MAX_DURATION = 86400; + // one day + /** * Shift is completely full. */ @@ -63,6 +69,9 @@ class ShiftsFilter { } public function setEndTime($endTime) { + if ($endTime - $this->startTime > ShiftsFilter::MAX_DURATION) { + $endTime = $this->startTime + ShiftsFilter::MAX_DURATION; + } $this->endTime = $endTime; }