Skip to content

events: Fill ics calendar with TZ-aware datetimes #26

Merged
merged 1 commit into from
Nov 11, 2019

Conversation

donald
Copy link
Member

@donald donald commented Nov 11, 2019

We filled the ics calendar used to produce the ics output with naive
datetime specifications without a tiemzone. The ics calendar assument
UTC and so the times of the exprted ICS calender were off.

The database doesn't containt datetimes, but seperate dates and times
which also don't have timezone information. The times are assumend to be
the timezone of the server (TIME_ZONE setting in
config/settings/base.py).

Use astimezone() from pytz library to add time zone information to
datetime values handed to the ICS calendar.

Acked-By: schrader@molgen.mpg.de

Fixes #23

We filled the ics calendar used to produce the ics output with naive
datetime specifications without a tiemzone. The ics calendar assument
UTC and so the times of the exprted ICS calender were off.

The database doesn't containt datetimes, but seperate dates and times
which also don't have timezone information. The times are assumend to be
the timezone of the server (TIME_ZONE setting in
config/settings/base.py).

Use astimezone() from pytz library to add time zone information to
datetime values handed to the ICS calendar.

Acked-By: schrader@molgen.mpg.de
@donald donald merged commit fc46f27 into master Nov 11, 2019
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Time Shift
1 participant