Skip to content

Commit 6ba7d05

Browse files
committed
BUG: defaulting to UTC tz rather than to None
1 parent cac347d commit 6ba7d05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

yaml2ics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ def utcnow():
4545
# This function can be used to add a list of e.g. exception dates (EXDATE) or
4646
# recurrence dates (RDATE) to a reoccurring event
4747
def add_recurrence_property(
48-
event: ics.Event, property_name, dates: map, tz: datetime.tzinfo = None
48+
event: ics.Event, property_name, dates: map, tz: datetime.tzinfo = dateutil.tz.UTC
4949
):
5050
event.extra.append(
5151
ics.ContentLine(
5252
name=property_name,
53-
params={"TZID": [str(ics.Timezone.from_tzinfo(tz))]} if tz else None,
53+
params={"TZID": [str(ics.Timezone.from_tzinfo(tz))]},
5454
value=",".join(dates),
5555
)
5656
)
5757

5858

59-
def event_from_yaml(event_yaml: dict, tz: datetime.tzinfo = None) -> ics.Event:
59+
def event_from_yaml(event_yaml: dict, tz: datetime.tzinfo = dateutil.tz.UTC) -> ics.Event:
6060
d = event_yaml
6161
repeat = d.pop("repeat", None)
6262
ics_custom = d.pop("ics", None)

0 commit comments

Comments
 (0)