From 9cd6d02eb0ae0f65eefdc96731515b476c33e8bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Valenta?= <tomas@imaniti.org>
Date: Sun, 5 May 2024 15:43:12 +0200
Subject: [PATCH] fix calendar parser

---
 calendar_utils/icalevents/icalparser.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/calendar_utils/icalevents/icalparser.py b/calendar_utils/icalevents/icalparser.py
index 71198fe2..a8e29564 100644
--- a/calendar_utils/icalevents/icalparser.py
+++ b/calendar_utils/icalevents/icalparser.py
@@ -528,7 +528,18 @@ def parse_rrule(component):
         # Add exdates to the rruleset
         for exd in extract_exdates(component):
             if type(dtstart) is date:
-                rule.exdate(exd.replace(tzinfo=None))
+                rule.exdate(
+                    datetime(
+                        year=exd.year,
+                        month=exd.month,
+                        day=exd.day,
+                        hour=0,
+                        minute=0,
+                        second=0
+                    )
+                    if isinstance(exd, date)
+                    else exd
+                )
             else:
                 rule.exdate(exd)
 
-- 
GitLab