-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1930466 - Part 1: Use zone.tab to guide time zone canonicalisatio…
…n. r=dminor Implement the changes from <tc39/ecma402#877> to reduce differences in time zone canonicalisation when compared to V8 and JSC (which both use CLDR time zone data instead of IANA time zone data). Implementing the `AvailableNamedTimeZoneIdentifiers` spec operation requires to link time zone identifiers to region codes. When the time zone is listed in the "zone.tab" file, we can get the region code from "zone.tab". In all other cases we need to manually map the time zone to a matching region, because CLDR doesn't have "public" data for this [1]. This is implemented using the new file "intl/TimeZoneMapping.yaml". ICU 74 added `ucal_getIanaTimeZoneID` to get the canonical IANA time zone id. Internally `ucal_getIanaTimeZoneID` first calls `ucal_getCanonicalTimeZoneID` and then loads a resource bundle to check if there are any time zone ids which need to be replaced with other ids for compatibility with IANA data. Unfortunately the resource bundle is not cached, so calling `ucal_getIanaTimeZoneID` instead of `ucal_getIanaTimeZoneID` adds a considerable performance overhead. To avoid any performance regressions, we keep our own time zone rewriting code for the time being. Using our own code also means we don't have to add a workaround for this CLDR bug: <https://unicode-org.atlassian.net/browse/CLDR-16439>. Also remove "Factory" from the list of supported time zone identifiers, because supporting it was always a bit questionable and latest V8 also doesn't support it anymore, so we shouldn't run into web-compat issues. Remove the old generated tests and add "timeZone_links.js" to ensure time zone links are correctly resolved. [1] Neither of these two files look like "public" data to me: - https://github.com/unicode-org/cldr/blob/main/tools/cldr-code/src/main/resources/org/unicode/cldr/util/data/TZID.txt - https://github.com/unicode-org/cldr/blob/main/tools/cldr-code/src/main/resources/org/unicode/cldr/icu/idList.txt Differential Revision: https://phabricator.services.mozilla.com/D228584
- Loading branch information
Showing
10 changed files
with
436 additions
and
595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
# Provide mapping from time zone identifiers to region codes for time zones | ||
# which aren't listed in tzdata's zone.tab file. | ||
|
||
Africa/Timbuktu: ML | ||
Africa/Asmera: ER | ||
|
||
America/Argentina/ComodRivadavia: AR | ||
America/Atka: US | ||
America/Buenos_Aires: AR | ||
America/Catamarca: AR | ||
America/Coral_Harbour: CA | ||
America/Cordoba: AR | ||
America/Ensenada: MX | ||
America/Fort_Wayne: US | ||
America/Godthab: GL | ||
America/Indianapolis: US | ||
America/Jujuy: AR | ||
America/Knox_IN: US | ||
America/Louisville: US | ||
America/Mendoza: AR | ||
America/Montreal: CA | ||
America/Nipigon: CA | ||
America/Pangnirtung: CA | ||
America/Porto_Acre: BR | ||
America/Rainy_River: CA | ||
America/Rosario: AR | ||
America/Santa_Isabel: MX | ||
America/Shiprock: US | ||
America/Thunder_Bay: CA | ||
America/Virgin: VI | ||
America/Yellowknife: CA | ||
|
||
Antarctica/South_Pole: AQ | ||
|
||
Asia/Choibalsan: MN | ||
Asia/Chongqing: CN | ||
Asia/Harbin: CN | ||
Asia/Kashgar: CN | ||
Asia/Tel_Aviv: IL | ||
Asia/Ashkhabad: TM | ||
Asia/Calcutta: IN | ||
Asia/Chungking: CN | ||
Asia/Dacca: BD | ||
Asia/Istanbul: TR | ||
Asia/Katmandu: NP | ||
Asia/Macao: MO | ||
Asia/Rangoon: MM | ||
Asia/Saigon: VN | ||
Asia/Thimbu: BT | ||
Asia/Ujung_Pandang: ID | ||
Asia/Ulan_Bator: MN | ||
|
||
Atlantic/Jan_Mayen: SJ | ||
Atlantic/Faeroe: FO | ||
|
||
Australia/ACT: AU | ||
Australia/LHI: AU | ||
Australia/NSW: AU | ||
Australia/Canberra: AU | ||
Australia/Currie: AU | ||
Australia/North: AU | ||
Australia/Queensland: AU | ||
Australia/South: AU | ||
Australia/Tasmania: AU | ||
Australia/Victoria: AU | ||
Australia/West: AU | ||
Australia/Yancowinna: AU | ||
|
||
Europe/Belfast: GB | ||
Europe/Tiraspol: MD | ||
Europe/Uzhgorod: UA | ||
Europe/Zaporozhye: UA | ||
Europe/Kiev: UA | ||
Europe/Nicosia: CY | ||
|
||
Pacific/Samoa: AS | ||
Pacific/Enderbury: KI | ||
Pacific/Johnston: US | ||
Pacific/Yap: FM | ||
Pacific/Ponape: FM | ||
Pacific/Truk: FM | ||
|
||
Brazil/Acre: BR | ||
Brazil/DeNoronha: BR | ||
Brazil/East: BR | ||
Brazil/West: BR | ||
|
||
Canada/Atlantic: CA | ||
Canada/Central: CA | ||
Canada/Eastern: CA | ||
Canada/Mountain: CA | ||
Canada/Newfoundland: CA | ||
Canada/Pacific: CA | ||
Canada/Saskatchewan: CA | ||
Canada/Yukon: CA | ||
|
||
Chile/Continental: CL | ||
Chile/EasterIsland: CL | ||
|
||
Mexico/BajaNorte: MX | ||
Mexico/BajaSur: MX | ||
Mexico/General: MX | ||
|
||
US/Alaska: US | ||
US/Aleutian: US | ||
US/Arizona: US | ||
US/Central: US | ||
US/East-Indiana: US | ||
US/Eastern: US | ||
US/Hawaii: US | ||
US/Indiana-Starke: US | ||
US/Michigan: US | ||
US/Mountain: US | ||
US/Pacific: US | ||
US/Samoa: AS | ||
|
||
CET: BE | ||
EET: GR | ||
MET: BE | ||
WET: PT | ||
|
||
CST6CDT: US | ||
EST5EDT: US | ||
EST: PA | ||
HST: US | ||
MST7MDT: US | ||
MST: US | ||
PST8PDT: US | ||
|
||
Cuba: CU | ||
Egypt: EG | ||
Eire: IE | ||
GB: GB | ||
GB-Eire: GB | ||
Hongkong: HK | ||
Iceland: IS | ||
Iran: IR | ||
Israel: IL | ||
Jamaica: JM | ||
Japan: JP | ||
Kwajalein: MH | ||
Libya: LY | ||
NZ: NZ | ||
NZ-CHAT: NZ | ||
Navajo: US | ||
PRC: CN | ||
Poland: PL | ||
Portugal: PT | ||
ROC: TW | ||
ROK: KR | ||
Singapore: SG | ||
Turkey: TR | ||
W-SU: RU |
Oops, something went wrong.