Commit graph

4 commits

Author SHA1 Message Date
Pēteris Caune
b2c5e91c70
Implement legacy -> canonical timezone conversion
There are three related changes:

* Removed legacy timezones from hc.lib.tz.all_timezones
* Added data migration to update existing Check.tz values
* For backwards compatibility, added code to automatically
  replace a legacy timezone with a canonical timezone when a
  legacy timezone is passed to an API call

I used the timezone mapping on
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
2024-06-14 12:55:57 +03:00
Pēteris Caune
c5bd666faf
Add data migration to update timezone "Europe/Kiev" to "Europe/Kyiv" 2024-06-13 15:03:51 +03:00
Pēteris Caune
161430fb10
Sort imports and add "from __future__ import annotations" 2022-10-17 16:52:15 +03:00
Pēteris Caune
c04d4e45b0
Switch from pytz.all_timezones to hc.lib.tz.all_timezones
In preparation to Django 4.0 upgrade, I'm removing non-essential
uses of pytz. One of the uses was to test if a timezone name
supplied by the user (e.g. "Europe/Riga") is valid by looking
it up in pytz.all_timezones.

This commit adds hc.lib.tz.all_timezones, which is a plain
simple Python list with timezone names. In the future,
I could in theory switch to zoneinfo.available_timezones(), but
will likely stick with the list.

hc.lib.tz.all_timezones is a
2021-12-11 10:51:13 +02:00