From c7aa94a94799f0a56e311b5e13faa88d32ba583a Mon Sep 17 00:00:00 2001 From: Michiel Vanzeir Date: Fri, 6 Dec 2024 18:16:35 +0100 Subject: [PATCH] Fix shift overlap bug: update logic to handle shifts starting and ending at the same time --- module/ShiftBundle/Entity/Shift.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/ShiftBundle/Entity/Shift.php b/module/ShiftBundle/Entity/Shift.php index 27808c86eb..394829c158 100644 --- a/module/ShiftBundle/Entity/Shift.php +++ b/module/ShiftBundle/Entity/Shift.php @@ -493,7 +493,7 @@ public function canHaveAsVolunteer(EntityManager $entityManager, Person $person) return false; } - if ($this->getStartDate() < $shift->getEndDate() && $shift->getStartDate() < $this->getEndDate()) { + if ($this->getStartDate() < $shift->getEndDate() && $shift->getStartDate() < $this->getEndDate() || $shift->getStartDate() === $this->getStartDate()) { return false; } }