From 89b70e44f519ef28c0ac1738066b2662b271208a Mon Sep 17 00:00:00 2001 From: Michiel Vanzeir Date: Sun, 1 Dec 2024 22:48:17 +0100 Subject: [PATCH] Fix shift overlap bug: update logic to handle shifts starting and ending at the same time --- module/ShiftBundle/Entity/RegistrationShift.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/ShiftBundle/Entity/RegistrationShift.php b/module/ShiftBundle/Entity/RegistrationShift.php index 4679ad7257..bbd7d93178 100644 --- a/module/ShiftBundle/Entity/RegistrationShift.php +++ b/module/ShiftBundle/Entity/RegistrationShift.php @@ -402,7 +402,7 @@ public function canHaveAsRegistered(EntityManager $entityManager, Person $regist return false; } - if ($this->getStartDate() < $shift->getEndDate() && $shift->getStartDate() < $this->getEndDate()) { + if ($this->getStartDate() < $shift->getEndDate() && $shift->getStartDate() < $this->getEndDate() || $this->getStartDate() === $shift->getStartDate()) { return false; }