diff options
author | msquare <msquare@notrademark.de> | 2016-12-28 00:11:42 +0100 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2016-12-28 00:11:42 +0100 |
commit | 65a665ee4919e6783fb9475f3acf652c0ff45b81 (patch) | |
tree | 353f3a6e80202668bc10b1c5acb1d68652f4da80 /includes/model | |
parent | aed9f2c96c922d7a0c6b3515d0f89d25e567e5cd (diff) |
reduce max shift filter duration to 24h
Diffstat (limited to 'includes/model')
-rw-r--r-- | includes/model/ShiftsFilter.php | 9 |
1 files changed, 9 insertions, 0 deletions
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 @@ -10,6 +10,12 @@ namespace Engelsystem; class ShiftsFilter { /** + * How long can the time interval be? + */ + const MAX_DURATION = 86400; + // one day + + /** * Shift is completely full. */ const FILLED_FILLED = 1; @@ -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; } |