mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
timezone: List only canonical timezone identifiers.
For aliases that will no longer be listed, see the third column of grep '^L ' zulip-py3-venv/lib/python3.*/site-packages/pytz/zoneinfo/tzdata.zi Time zones previously set to an alias will be canonicalized on demand. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
c4af509339
commit
961633fcec
@@ -1,11 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
import pytz
|
||||
|
||||
ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../")
|
||||
sys.path.insert(0, ZULIP_PATH)
|
||||
|
||||
from zerver.lib.timezone import get_canonical_timezone_map
|
||||
|
||||
OUT_PATH = os.path.join(ZULIP_PATH, "static", "generated", "timezones.json")
|
||||
|
||||
with open(OUT_PATH, "w") as f:
|
||||
json.dump({"timezones": pytz.all_timezones}, f)
|
||||
json.dump({"timezones": sorted(pytz.all_timezones_set - set(get_canonical_timezone_map()))}, f)
|
||||
|
||||
Reference in New Issue
Block a user