Skip to content

Commit 9a9b1a5

Browse files
author
Bijan Chokoufe Nejad
committed
moved all_day out of RRULE
1 parent 5b66dfb commit 9a9b1a5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

calendar_parser.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,12 @@ def parse_ics(self, overwrite_events=True):
343343
event_dict["start_time"] = _fix_timezone(event["dtstart"].dt, self.time_zone)
344344
if "DTEND" in event:
345345
event_dict["end_time"] = _fix_timezone(event["dtend"].dt, self.time_zone)
346+
if event_dict["start_time"].hour == 0 \
347+
and event_dict["start_time"].minute == 0 \
348+
and (event_dict["end_time"] - event_dict["start_time"]) == timedelta(days=1):
349+
event_dict["all_day"] = True
350+
else:
351+
event_dict["all_day"] = False
346352

347353
event_dict["repeats"] = False
348354
if "RRULE" in event:
@@ -355,13 +361,6 @@ def parse_ics(self, overwrite_events=True):
355361
event_dict["repeat_day"] = event_dict["start_time"].day
356362
event_dict["repeat_month"] = event_dict["start_time"].month
357363

358-
if event_dict["start_time"].hour == 0 \
359-
and event_dict["start_time"].minute == 0 \
360-
and (event_dict["end_time"] - event_dict["start_time"]) == timedelta(days=1):
361-
event_dict["all_day"] = True
362-
else:
363-
event_dict["all_day"] = False
364-
365364
if "BYDAY" in rep_dict:
366365
event_dict["repeat_day"] = rep_dict["BYDAY"][0]
367366
elif "BYMONTHDAY" in rep_dict:

0 commit comments

Comments
 (0)