mirror of https://github.com/zulip/zulip.git
25 lines
593 B
Python
Executable File
25 lines
593 B
Python
Executable File
#!/usr/bin/env python3
|
|
import json
|
|
import os
|
|
import sys
|
|
import zoneinfo
|
|
|
|
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, "web", "generated", "timezones.json")
|
|
|
|
with open(OUT_PATH, "w") as f:
|
|
json.dump(
|
|
{
|
|
"timezones": sorted(
|
|
zoneinfo.available_timezones()
|
|
- {"Factory", "localtime"}
|
|
- set(get_canonical_timezone_map())
|
|
)
|
|
},
|
|
f,
|
|
)
|