Replies: 1 comment
-
Here is something close to a complete list of exactly equal timezones (after filtering of 1970) const links = {
"America/Edmonton": ["America/Yellowknife"],
"America/Iqaluit": ["America/Pangnirtung"],
"America/Toronto": ["America/Nassau", "America/Nipigon", "America/Thunder_Bay"],
"America/Winnipeg": ["America/Rainy_River"],
"Pacific/Auckland": ["Antarctica/McMurdo"],
"Europe/Berlin": [
"Arctic/Longyearbyen",
"Europe/Copenhagen",
"Europe/Oslo",
"Europe/Stockholm"
],
"Asia/Qatar": ["Asia/Bahrain"],
"Asia/Ulaanbaatar": ["Asia/Choibalsan"],
"Asia/Singapore": ["Asia/Kuala_Lumpur"],
"Europe/Brussels": ["Europe/Amsterdam", "Europe/Luxembourg"],
"Europe/Belgrade": [
"Europe/Ljubljana",
"Europe/Podgorica",
"Europe/Sarajevo",
"Europe/Skopje",
"Europe/Zagreb"
],
"Europe/Prague": ["Europe/Bratislava"],
"Europe/Zurich": ["Europe/Vaduz", "Europe/Busingen"],
"Europe/London": ["Europe/Guernsey", "Europe/Isle_of_Man", "Europe/Jersey"],
"Europe/Helsinki": ["Europe/Mariehamn"],
"Europe/Kyiv": ["Europe/Uzhgorod", "Europe/Zaporozhye"],
"Europe/Paris": ["Europe/Monaco"],
"Europe/Rome": ["Europe/San_Marino", "Europe/Vatican"],
"Pacific/Guam": ["Pacific/Saipan"]
}; And removing those saves another ~200kb, it seems. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context:
In our website, we have to support languages that some browsers do not support (looking at you Chrome); do time math; and show the result in a pretty "2 months ago" and "monday" in those langauges.
Because of lack of native support by all browsers we use formatjs and load it if it's needed. Of course, part of the polyfills is the tz polyfill, and we've been using
add-golden-tz.js
since it's around half the size of theadd-all-tz.js
.Everything was fine for a while, untill one of our customers taken a flight to Kazakhstan, where his laptop switched to
Asia/Quostana
and website crashed since this is not one of the "golden" timezones, whatever they are, so now we will have to switch toadd-all-tz
.Loading 1.3 megabytes of text every time the website loads, is, in my a opinion, a big waste.
Proposal:
Instead of arbitrarily selecting
golden
timezones, why not remove the historical data? My and, I believe, many other websites do not care for dates earlier than 1970.Doing a quick filter seems to have removed 100kbs of data. (a)
But then I looked into the data some more and relaised that it contains precomputed dates for all summer time switches for every timezone up until 2099.
They can be calculated on the client instead of being sent over the wire. (b)
If calculating them is hard, then at least links should be respected and unpacked, like
Europe/Copenhagen
,Europe/Stockholm
,Europe/Oslo
... being the same asEurope/Berlin
. (c)So, I hope that this library replaces
golden
tz set witha + b
or at leasta + c
, and I'm willing to help out with PRs.Beta Was this translation helpful? Give feedback.
All reactions