From d23fe92ff6c1c9fe2562258a7fdd45bf786cf0b3 Mon Sep 17 00:00:00 2001
From: Peter Thienel <thienel@data-quest.de>
Date: Wed, 20 Mar 2024 14:19:11 +0100
Subject: [PATCH] use always the server's timezone, re #3843

---
 lib/models/calendar/CalendarDateAssignment.class.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/models/calendar/CalendarDateAssignment.class.php b/lib/models/calendar/CalendarDateAssignment.class.php
index 8eb536f90f7..37e3b66026e 100644
--- a/lib/models/calendar/CalendarDateAssignment.class.php
+++ b/lib/models/calendar/CalendarDateAssignment.class.php
@@ -217,6 +217,11 @@ class CalendarDateAssignment extends SimpleORMap implements Event
         bool $with_declined = false
     ) : array
     {
+        // use always the server's timezone
+        $local_timezone = (new DateTime())->getTimezone();
+        $begin->setTimezone($local_timezone);
+        $end->setTimezone($local_timezone);
+
         // one whole day as minimum (begin and end time stamp at the same day)
         $begin->modify('midnight');
         $end->modify('tomorrow -1 second');
-- 
GitLab