summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-12-28 00:11:42 +0100
committermsquare <msquare@notrademark.de>2016-12-28 00:11:42 +0100
commit65a665ee4919e6783fb9475f3acf652c0ff45b81 (patch)
tree353f3a6e80202668bc10b1c5acb1d68652f4da80
parentaed9f2c96c922d7a0c6b3515d0f89d25e567e5cd (diff)
reduce max shift filter duration to 24h
-rw-r--r--includes/model/ShiftsFilter.php9
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;
}