-
Notifications
You must be signed in to change notification settings - Fork 7
Default to UTC timezone #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
a2c593a
95b8a7d
a4405a8
fa9a56c
765d473
e9fdbc6
00216b5
765a076
c5d4b82
344bdf0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,18 +52,20 @@ def gettz(tzname: str) -> datetime.tzinfo: | |
| # This function can be used to add a list of e.g. exception dates (EXDATE) or | ||
| # recurrence dates (RDATE) to a reoccurring event | ||
| def add_recurrence_property( | ||
| event: ics.Event, property_name, dates: map, tz: datetime.tzinfo = None | ||
| event: ics.Event, property_name, dates: map, tz: datetime.tzinfo = dateutil.tz.UTC | ||
| ): | ||
| event.extra.append( | ||
| ics.ContentLine( | ||
| name=property_name, | ||
| params={"TZID": [str(ics.Timezone.from_tzinfo(tz))]} if tz else None, | ||
| params={"TZID": [str(ics.Timezone.from_tzinfo(tz))]}, | ||
| value=",".join(dates), | ||
| ) | ||
| ) | ||
|
|
||
|
|
||
| def event_from_yaml(event_yaml: dict, tz: datetime.tzinfo = None) -> ics.Event: | ||
| def event_from_yaml( | ||
| event_yaml: dict, tz: datetime.tzinfo = dateutil.tz.UTC | ||
|
||
| ) -> ics.Event: | ||
| d = event_yaml | ||
| repeat = d.pop("repeat", None) | ||
| ics_custom = d.pop("ics", None) | ||
|
|
@@ -184,6 +186,8 @@ def files_to_events(files: list) -> (ics.Calendar, str): | |
| tz = calendar_yaml.get("timezone", None) | ||
| if tz is not None: | ||
| tz = gettz(tz) | ||
| else: | ||
bsipocz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| tz = dateutil.tz.UTC | ||
| if "include" in calendar_yaml: | ||
| included_events, _name = files_to_events( | ||
| os.path.join(os.path.dirname(f), newfile) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we make TZ required for now; this is for internal use anyway.