From 1952cd5f520a348508acee226b06441c85eb61fd Mon Sep 17 00:00:00 2001
From: Peter Thienel <thienel@data-quest.de>
Date: Thu, 21 Mar 2024 07:38:10 +0000
Subject: [PATCH] Resolve "Wiederholungstermine werden am Tag der
 Sommerzeitumstellung nicht korrekt angezeigt"

Closes #3843

Merge request studip/studip!2710


(cherry picked from commit d77720089d00526e9ddc7d9f565e5c8bdcc5ff71)

d23fe92f use always the server's timezone, re #3843
89c241db fixed error in comment
---
 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 a5776f70b46..670ee22e2c2 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
     {
+        // Always use the timezone of the server:
+        $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