summaryrefslogtreecommitdiff
path: root/postgresqleu/util/time.py
AgeCommit message (Collapse)Author
2021-01-25Add utility functions to format times in the global tzMagnus Hagander
When going through templates the system takes care of it, but when manually rendering in the backend case needs to be taken, so add some utilities.
2020-04-12Enable full timezone managementMagnus Hagander
Switch the system to properly use django and postgres timezone support, by allowing each conference to render all date related information in a conference specific timezone (using the one that has already been specified on the conference, per a previous commit). All non-conference parts of the system keep using the default timezone as specified in settings.TIME_ZONE. This includes a migration that updates the existing sessions, session slots and volunteer slots based on what timezone has been configured for the conference (since previously everything was stored in the wrong timezone if the conference was in anything but the default one). In order to make this work for non-django-orm queries, a context manager that swaps the timezone to the conference and back out is introduced, and related to that a way to get a cursor that turns off django's protection against doing exactly this. This finally removes the very ugly "timediff" column on the conference which was a quick hack back in the days to support ical feeds using utc. In passing, this also: * Fixes ical feeds to include all required fields (uid and dtstamp were missing on schedule entries) * Fixes xml feed to use conference local time (fixes #8) * Clarify what "valid until" and "active until" means in the help text on discount codes and registration tpes. * Don't duplicate dates in schedule xml feeds (seems others don't, and there is no clear spec anywhere that I can find)
2020-03-31Create abstraction for getting "today"Magnus Hagander
This will work differently for conferences and non-conferences once we add proper timezone support, so abstract it out into a separate couple of functions. For now they both return the same thing, but this will change in a later commit. In passing, fix missing datetime.now() -> timezone.now() conversions.