Fix type confusion bug in recurring events

This commit is contained in:
s3lph 2020-06-19 00:35:12 +02:00
parent 7dad5ff034
commit 58145fe178

View file

@ -26,6 +26,8 @@ def _parse_recurring(event: cal.Event, start: datetime, end: datetime, duration:
occurences: List[datetime] = [] occurences: List[datetime] = []
evstart = event.get('dtstart').dt evstart = event.get('dtstart').dt
if isinstance(evstart, date) and not isinstance(evstart, datetime):
evstart = datetime(evstart.year, evstart.month, evstart.day, tzinfo=start.tzinfo)
# First occurence lies in the future; no need to process further # First occurence lies in the future; no need to process further
if evstart >= end: if evstart >= end:
return occurences return occurences