Skip to content

Commit

Permalink
fixup! Test Temporal.TimeZone ID case normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
justingrant committed Jul 19, 2023
1 parent c8ffb98 commit 8dde64f
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ features: [Temporal, time-zone-canonicalization]
---*/

const timeZoneIdentifiers = [
// IANA TZDB Zone names
'Africa/Abidjan',
'Africa/Algiers',
'Africa/Bissau',
Expand Down Expand Up @@ -58,7 +59,7 @@ const timeZoneIdentifiers = [
'America/Cayenne',
'America/Chicago',
'America/Chihuahua',
// 'America/Ciudad_Juarez',
// 'America/Ciudad_Juarez' // uncomment after Node supports this ID added in TZDB 2022g
'America/Costa_Rica',
'America/Cuiaba',
'America/Danmarkshavn',
Expand Down Expand Up @@ -358,6 +359,8 @@ const timeZoneIdentifiers = [
'Pacific/Tahiti',
'Pacific/Tarawa',
'Pacific/Tongatapu',

// IANA TZDB Link names
'WET',
'Africa/Accra',
'Africa/Addis_Ababa',
Expand Down Expand Up @@ -607,6 +610,11 @@ const timeZoneIdentifiers = [
'Zulu'
];

// We want to test all available named time zone identifiers (both primary and non-primary),
// but no ECMAScript built-in API exposes that list. So we use a union of two sources:
// 1. A hard-coded list of Zone and Link identifiers from the 2022g version of IANA TZDB.
// 2. Canonical IDs exposed by Intl.supportedValuesOf('timeZone'), which ensures that IDs
// added to TZDB later than 2022g will be tested. (New IDs are almost always added as primary.)
const ids = [...new Set([...timeZoneIdentifiers, ...Intl.supportedValuesOf('timeZone')])];
for (const id of ids) {
const lower = id.toLowerCase();
Expand Down

0 comments on commit 8dde64f

Please sign in to comment.