summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}