From b9d00b1742f47f3eedfc86c5fe48b852d3b11158 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sat, 2 Dec 2023 15:15:38 +0100 Subject: [PATCH] Improved event time loading #410 --- bot/src/modules/base/service/event_service.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bot/src/modules/base/service/event_service.py b/bot/src/modules/base/service/event_service.py index 7e298d9d..75656c1b 100644 --- a/bot/src/modules/base/service/event_service.py +++ b/bot/src/modules/base/service/event_service.py @@ -114,12 +114,18 @@ class EventService: kwargs["channel"] = guild.get_channel(scheduled_event.channel_id) if scheduled_event.start_time is not None: - scheduled_event.start_time = self._append_interval(scheduled_event.interval, scheduled_event.start_time) - kwargs["start_time"] = scheduled_event.start_time.replace(tzinfo=ZoneInfo("Europe/Berlin")) + start_time = self._append_interval( + scheduled_event.interval, scheduled_event.start_time.replace(tzinfo=ZoneInfo("Europe/Berlin")) + ) + kwargs["start_time"] = start_time + scheduled_event.start_time = scheduled_event.start_time.replace(tzinfo=None) if scheduled_event.end_time is not None: - scheduled_event.end_time = self._append_interval(scheduled_event.interval, scheduled_event.end_time) - kwargs["end_time"] = scheduled_event.end_time.replace(tzinfo=ZoneInfo("Europe/Berlin")) + end_time = self._append_interval( + scheduled_event.interval, scheduled_event.end_time.replace(tzinfo=ZoneInfo("Europe/Berlin")) + ) + kwargs["end_time"] = end_time + scheduled_event.end_time = scheduled_event.end_time.replace(tzinfo=None) kwargs["entity_type"] = scheduled_event.entity_type if scheduled_event.location is not None: