Skip to content

Commit

Permalink
fix(input-time-zone): fix region mode labeling and value mapping (#10345
Browse files Browse the repository at this point in the history
)

**Related Issue:** #10289

## Summary

This makes the following improvements to `input-time-zone`'s `region`
mode:

* lists canonical IANA time zones
* maps obsolete/aliased time zones to their canonical equivalent
* ensures time zone values are consistent across browsers
* includes global time zones (e.g., without a country associated)
* updates label appropriately when value is set programmatically
* improves labels
* simplifies test suite (`Intl` APIs no longer necessary)

**Note**: this bumps `time-zones` to version 0.10.2
  • Loading branch information
jcfranco authored Sep 25, 2024
1 parent 98548e4 commit cf36299
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 194 deletions.
11 changes: 6 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/calcite-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"interactjs": "1.10.27",
"lodash-es": "4.17.21",
"sortablejs": "1.15.3",
"timezone-groups": "0.9.1",
"timezone-groups": "0.10.2",
"type-fest": "4.18.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@
"America/Anguilla": "Anguilla",
"America/Antigua": "Antigua",
"America/Araguaina": "Araguaina",
"America/Argentina/Buenos_Aires": "Buenos Aires",
"America/Argentina/Catamarca": "Catamarca",
"America/Argentina/Cordoba": "Cordoba",
"America/Argentina/Jujuy": "Jujuy",
"America/Argentina/La_Rioja": "La Rioja",
"America/Argentina/Mendoza": "Mendoza",
"America/Argentina/Rio_Gallegos": "Rio Gallegos",
"America/Argentina/Salta": "Salta",
"America/Argentina/San_Juan": "San Juan",
Expand Down Expand Up @@ -120,6 +125,7 @@
"America/Halifax": "Halifax",
"America/Havana": "Havana",
"America/Hermosillo": "Hermosillo",
"America/Indiana/Indianapolis": "Indianapolis",
"America/Indiana/Knox": "Knox",
"America/Indiana/Marengo": "Marengo",
"America/Indiana/Petersburg": "Petersburg",
Expand All @@ -133,6 +139,7 @@
"America/Jamaica": "Jamaica",
"America/Jujuy": "Jujuy",
"America/Juneau": "Juneau",
"America/Kentucky/Louisville": "Louisville",
"America/Kentucky/Monticello": "Monticello",
"America/Kralendijk": "Kralendijk",
"America/La_Paz": "La Paz",
Expand Down Expand Up @@ -166,6 +173,7 @@
"America/North_Dakota/Beulah": "Beulah",
"America/North_Dakota/Center": "Center",
"America/North_Dakota/New_Salem": "New Salem",
"America/Nuuk": "Nuuk",
"America/Ojinaga": "Ojinaga",
"America/Panama": "Panama",
"America/Pangnirtung": "Pangnirtung",
Expand Down Expand Up @@ -247,6 +255,7 @@
"Asia/Famagusta": "Famagusta",
"Asia/Gaza": "Gaza",
"Asia/Hebron": "Hebron",
"Asia/Ho_Chi_Minh": "Ho Chi Minh",
"Asia/Hong_Kong": "Hong Kong",
"Asia/Hovd": "Hovd",
"Asia/Irkutsk": "Irkutsk",
Expand All @@ -257,7 +266,9 @@
"Asia/Kamchatka": "Kamchatka",
"Asia/Karachi": "Karachi",
"Asia/Katmandu": "Katmandu",
"Asia/Kathmandu": "Kathmandu",
"Asia/Khandyga": "Khandyga",
"Asia/Kolkata": "Kolkata",
"Asia/Krasnoyarsk": "Krasnoyarsk",
"Asia/Kuala_Lumpur": "Kuala Lumpur",
"Asia/Kuching": "Kuching",
Expand Down Expand Up @@ -300,13 +311,15 @@
"Asia/Vientiane": "Vientiane",
"Asia/Vladivostok": "Vladivostok",
"Asia/Yakutsk": "Yakutsk",
"Asia/Yangon": "Yangon",
"Asia/Yekaterinburg": "Yekaterinburg",
"Asia/Yerevan": "Yerevan",
"Atlantic/Azores": "Azores",
"Atlantic/Bermuda": "Bermuda",
"Atlantic/Canary": "Canary",
"Atlantic/Cape_Verde": "Cape Verde",
"Atlantic/Faeroe": "Faeroe",
"Atlantic/Faroe": "Faroe Islands",
"Atlantic/Madeira": "Madeira",
"Atlantic/Reykjavik": "Reykjavik",
"Atlantic/South_Georgia": "South Georgia",
Expand All @@ -325,6 +338,34 @@
"Australia/Perth": "Perth",
"Australia/Sydney": "Sydney",
"Europe/Amsterdam": "Amsterdam",
"Etc/GMT": "GMT",
"Etc/GMT+1": "GMT-1",
"Etc/GMT+10": "GMT-10",
"Etc/GMT+11": "GMT-11",
"Etc/GMT+12": "GMT-12",
"Etc/GMT+2": "GMT-2",
"Etc/GMT+3": "GMT-3",
"Etc/GMT+4": "GMT-4",
"Etc/GMT+5": "GMT-5",
"Etc/GMT+6": "GMT-6",
"Etc/GMT+7": "GMT-7",
"Etc/GMT+8": "GMT-8",
"Etc/GMT+9": "GMT-9",
"Etc/GMT-1": "GMT+1",
"Etc/GMT-10": "GMT+10",
"Etc/GMT-11": "GMT+11",
"Etc/GMT-12": "GMT+12",
"Etc/GMT-13": "GMT+13",
"Etc/GMT-14": "GMT+14",
"Etc/GMT-2": "GMT+2",
"Etc/GMT-3": "GMT+3",
"Etc/GMT-4": "GMT+4",
"Etc/GMT-5": "GMT+5",
"Etc/GMT-6": "GMT+6",
"Etc/GMT-7": "GMT+7",
"Etc/GMT-8": "GMT+8",
"Etc/GMT-9": "GMT+9",
"Etc/UTC": "Coordinated Universal Time (UTC)",
"Europe/Andorra": "Andorra",
"Europe/Astrakhan": "Astrakhan",
"Europe/Athens": "Athens",
Expand All @@ -347,6 +388,7 @@
"Europe/Kaliningrad": "Kaliningrad",
"Europe/Kiev": "Kiev",
"Europe/Kirov": "Kirov",
"Europe/Kyiv": "Kyiv",
"Europe/Lisbon": "Lisbon",
"Europe/Ljubljana": "Ljubljana",
"Europe/London": "London",
Expand Down Expand Up @@ -385,6 +427,7 @@
"Europe/Zaporozhye": "Zaporozhye",
"Europe/Zurich": "Zurich",
"Indian/Antananarivo": "Antananarivo",
"Factory": "System Default Time",
"Indian/Chagos": "Chagos",
"Indian/Christmas": "Christmas Island",
"Indian/Cocos": "Cocos",
Expand All @@ -411,6 +454,7 @@
"Pacific/Guam": "Guam",
"Pacific/Honolulu": "Honolulu",
"Pacific/Johnston": "Johnston",
"Pacific/Kanton": "Kanton",
"Pacific/Kiritimati": "Kiritimati",
"Pacific/Kosrae": "Kosrae",
"Pacific/Kwajalein": "Kwajalein",
Expand All @@ -419,7 +463,7 @@
"Pacific/Midway": "Midway",
"Pacific/Nauru": "Nauru",
"Pacific/Niue": "Niue",
"Pacific/Norfolk": "Norfolk",
"Pacific/Norfolk": "Norfolk Island",
"Pacific/Noumea": "Noumea",
"Pacific/Pago_Pago": "Pago Pago",
"Pacific/Palau": "Palau",
Expand All @@ -442,6 +486,7 @@
"Atlantic": "Atlantic",
"Australia": "Australia",
"Europe": "Europe",
"Global": "Global",
"Indian": "Indian",
"Pacific": "Pacific",
"AD": "Andorra",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@
"America/Anguilla": "Anguilla",
"America/Antigua": "Antigua",
"America/Araguaina": "Araguaina",
"America/Argentina/Buenos_Aires": "Buenos Aires",
"America/Argentina/Catamarca": "Catamarca",
"America/Argentina/Cordoba": "Cordoba",
"America/Argentina/Jujuy": "Jujuy",
"America/Argentina/La_Rioja": "La Rioja",
"America/Argentina/Mendoza": "Mendoza",
"America/Argentina/Rio_Gallegos": "Rio Gallegos",
"America/Argentina/Salta": "Salta",
"America/Argentina/San_Juan": "San Juan",
Expand Down Expand Up @@ -120,6 +125,7 @@
"America/Halifax": "Halifax",
"America/Havana": "Havana",
"America/Hermosillo": "Hermosillo",
"America/Indiana/Indianapolis": "Indianapolis",
"America/Indiana/Knox": "Knox",
"America/Indiana/Marengo": "Marengo",
"America/Indiana/Petersburg": "Petersburg",
Expand All @@ -133,6 +139,7 @@
"America/Jamaica": "Jamaica",
"America/Jujuy": "Jujuy",
"America/Juneau": "Juneau",
"America/Kentucky/Louisville": "Louisville",
"America/Kentucky/Monticello": "Monticello",
"America/Kralendijk": "Kralendijk",
"America/La_Paz": "La Paz",
Expand Down Expand Up @@ -166,6 +173,7 @@
"America/North_Dakota/Beulah": "Beulah",
"America/North_Dakota/Center": "Center",
"America/North_Dakota/New_Salem": "New Salem",
"America/Nuuk": "Nuuk",
"America/Ojinaga": "Ojinaga",
"America/Panama": "Panama",
"America/Pangnirtung": "Pangnirtung",
Expand Down Expand Up @@ -247,6 +255,7 @@
"Asia/Famagusta": "Famagusta",
"Asia/Gaza": "Gaza",
"Asia/Hebron": "Hebron",
"Asia/Ho_Chi_Minh": "Ho Chi Minh",
"Asia/Hong_Kong": "Hong Kong",
"Asia/Hovd": "Hovd",
"Asia/Irkutsk": "Irkutsk",
Expand All @@ -257,7 +266,9 @@
"Asia/Kamchatka": "Kamchatka",
"Asia/Karachi": "Karachi",
"Asia/Katmandu": "Katmandu",
"Asia/Kathmandu": "Kathmandu",
"Asia/Khandyga": "Khandyga",
"Asia/Kolkata": "Kolkata",
"Asia/Krasnoyarsk": "Krasnoyarsk",
"Asia/Kuala_Lumpur": "Kuala Lumpur",
"Asia/Kuching": "Kuching",
Expand Down Expand Up @@ -300,13 +311,15 @@
"Asia/Vientiane": "Vientiane",
"Asia/Vladivostok": "Vladivostok",
"Asia/Yakutsk": "Yakutsk",
"Asia/Yangon": "Yangon",
"Asia/Yekaterinburg": "Yekaterinburg",
"Asia/Yerevan": "Yerevan",
"Atlantic/Azores": "Azores",
"Atlantic/Bermuda": "Bermuda",
"Atlantic/Canary": "Canary",
"Atlantic/Cape_Verde": "Cape Verde",
"Atlantic/Faeroe": "Faeroe",
"Atlantic/Faroe": "Faroe Islands",
"Atlantic/Madeira": "Madeira",
"Atlantic/Reykjavik": "Reykjavik",
"Atlantic/South_Georgia": "South Georgia",
Expand All @@ -325,6 +338,34 @@
"Australia/Perth": "Perth",
"Australia/Sydney": "Sydney",
"Europe/Amsterdam": "Amsterdam",
"Etc/GMT": "GMT",
"Etc/GMT+1": "GMT-1",
"Etc/GMT+10": "GMT-10",
"Etc/GMT+11": "GMT-11",
"Etc/GMT+12": "GMT-12",
"Etc/GMT+2": "GMT-2",
"Etc/GMT+3": "GMT-3",
"Etc/GMT+4": "GMT-4",
"Etc/GMT+5": "GMT-5",
"Etc/GMT+6": "GMT-6",
"Etc/GMT+7": "GMT-7",
"Etc/GMT+8": "GMT-8",
"Etc/GMT+9": "GMT-9",
"Etc/GMT-1": "GMT+1",
"Etc/GMT-10": "GMT+10",
"Etc/GMT-11": "GMT+11",
"Etc/GMT-12": "GMT+12",
"Etc/GMT-13": "GMT+13",
"Etc/GMT-14": "GMT+14",
"Etc/GMT-2": "GMT+2",
"Etc/GMT-3": "GMT+3",
"Etc/GMT-4": "GMT+4",
"Etc/GMT-5": "GMT+5",
"Etc/GMT-6": "GMT+6",
"Etc/GMT-7": "GMT+7",
"Etc/GMT-8": "GMT+8",
"Etc/GMT-9": "GMT+9",
"Etc/UTC": "Coordinated Universal Time (UTC)",
"Europe/Andorra": "Andorra",
"Europe/Astrakhan": "Astrakhan",
"Europe/Athens": "Athens",
Expand All @@ -347,6 +388,7 @@
"Europe/Kaliningrad": "Kaliningrad",
"Europe/Kiev": "Kiev",
"Europe/Kirov": "Kirov",
"Europe/Kyiv": "Kyiv",
"Europe/Lisbon": "Lisbon",
"Europe/Ljubljana": "Ljubljana",
"Europe/London": "London",
Expand Down Expand Up @@ -385,6 +427,7 @@
"Europe/Zaporozhye": "Zaporozhye",
"Europe/Zurich": "Zurich",
"Indian/Antananarivo": "Antananarivo",
"Factory": "System Default Time",
"Indian/Chagos": "Chagos",
"Indian/Christmas": "Christmas Island",
"Indian/Cocos": "Cocos",
Expand All @@ -411,6 +454,7 @@
"Pacific/Guam": "Guam",
"Pacific/Honolulu": "Honolulu",
"Pacific/Johnston": "Johnston",
"Pacific/Kanton": "Kanton",
"Pacific/Kiritimati": "Kiritimati",
"Pacific/Kosrae": "Kosrae",
"Pacific/Kwajalein": "Kwajalein",
Expand All @@ -419,7 +463,7 @@
"Pacific/Midway": "Midway",
"Pacific/Nauru": "Nauru",
"Pacific/Niue": "Niue",
"Pacific/Norfolk": "Norfolk",
"Pacific/Norfolk": "Norfolk Island",
"Pacific/Noumea": "Noumea",
"Pacific/Pago_Pago": "Pago Pago",
"Pacific/Palau": "Palau",
Expand All @@ -442,6 +486,7 @@
"Atlantic": "Atlantic",
"Australia": "Australia",
"Europe": "Europe",
"Global": "Global",
"Indian": "Indian",
"Pacific": "Pacific",
"AD": "Andorra",
Expand Down
Loading

0 comments on commit cf36299

Please sign in to comment.