timezones.tsx 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. import styled from '@emotion/styled';
  2. import groupBy from 'lodash/groupBy';
  3. import moment from 'moment-timezone';
  4. import type {SelectValue} from 'sentry/types/core';
  5. type TimezoneGroup =
  6. | null
  7. | 'Other'
  8. | 'US/Canada'
  9. | 'America'
  10. | 'Europe'
  11. | 'Australia'
  12. | 'Asia'
  13. | 'Indian'
  14. | 'Africa'
  15. | 'Pacific'
  16. | 'Atlantic'
  17. | 'Antarctica'
  18. | 'Arctic';
  19. const timezones: [group: TimezoneGroup, value: string, label: string][] = [
  20. ['Other', 'UTC', 'UTC'],
  21. ['Other', 'GMT', 'GMT'],
  22. // Group US higher-ish since
  23. ['US/Canada', 'US/Eastern', 'Eastern'],
  24. ['US/Canada', 'US/Central', 'Central'],
  25. ['US/Canada', 'US/Arizona', 'Arizona'],
  26. ['US/Canada', 'US/Mountain', 'Mountain'],
  27. ['US/Canada', 'US/Pacific', 'Pacific'],
  28. ['US/Canada', 'US/Alaska', 'Alaska'],
  29. ['US/Canada', 'US/Hawaii', 'Hawaii'],
  30. ['US/Canada', 'Canada/Newfoundland', 'Newfoundland'],
  31. ['US/Canada', 'Canada/Atlantic', 'Atlantic'],
  32. ['US/Canada', 'Canada/Eastern', 'Canadian Eastern'],
  33. ['US/Canada', 'Canada/Central', 'Canadian Central'],
  34. ['US/Canada', 'Canada/Mountain', 'Canadian Mountain'],
  35. ['US/Canada', 'Canada/Pacific', 'Canadian Pacific'],
  36. ['America', 'America/Danmarkshavn', 'Danmarkshavn'],
  37. ['America', 'America/Scoresbysund', 'Scoresbysund'],
  38. ['America', 'America/Noronha', 'Noronha'],
  39. ['America', 'America/Araguaina', 'Araguaina'],
  40. ['America', 'America/Argentina/Buenos_Aires', 'Argentina / Buenos Aires'],
  41. ['America', 'America/Argentina/Catamarca', 'Argentina / Catamarca'],
  42. ['America', 'America/Argentina/Cordoba', 'Argentina / Cordoba'],
  43. ['America', 'America/Argentina/Jujuy', 'Argentina / Jujuy'],
  44. ['America', 'America/Argentina/La_Rioja', 'Argentina / La Rioja'],
  45. ['America', 'America/Argentina/Mendoza', 'Argentina / Mendoza'],
  46. ['America', 'America/Argentina/Rio_Gallegos', 'Argentina / Rio Gallegos'],
  47. ['America', 'America/Argentina/Salta', 'Argentina / Salta'],
  48. ['America', 'America/Argentina/San_Juan', 'Argentina / San Juan'],
  49. ['America', 'America/Argentina/San_Luis', 'Argentina / San Luis'],
  50. ['America', 'America/Argentina/Tucuman', 'Argentina / Tucuman'],
  51. ['America', 'America/Argentina/Ushuaia', 'Argentina / Ushuaia'],
  52. ['America', 'America/Asuncion', 'Asuncion'],
  53. ['America', 'America/Bahia', 'Bahia'],
  54. ['America', 'America/Belem', 'Belem'],
  55. ['America', 'America/Campo_Grande', 'Campo Grande'],
  56. ['America', 'America/Cayenne', 'Cayenne'],
  57. ['America', 'America/Cuiaba', 'Cuiaba'],
  58. ['America', 'America/Fortaleza', 'Fortaleza'],
  59. ['America', 'America/Godthab', 'Godthab'],
  60. ['America', 'America/Maceio', 'Maceio'],
  61. ['America', 'America/Miquelon', 'Miquelon'],
  62. ['America', 'America/Montevideo', 'Montevideo'],
  63. ['America', 'America/Paramaribo', 'Paramaribo'],
  64. ['America', 'America/Recife', 'Recife'],
  65. ['America', 'America/Santarem', 'Santarem'],
  66. ['America', 'America/Santiago', 'Santiago'],
  67. ['America', 'America/Sao_Paulo', 'Sao Paulo'],
  68. ['America', 'America/St_Johns', 'St Johns'],
  69. ['America', 'America/Anguilla', 'Anguilla'],
  70. ['America', 'America/Antigua', 'Antigua'],
  71. ['America', 'America/Aruba', 'Aruba'],
  72. ['America', 'America/Barbados', 'Barbados'],
  73. ['America', 'America/Blanc-Sablon', 'Blanc-Sablon'],
  74. ['America', 'America/Boa_Vista', 'Boa Vista'],
  75. ['America', 'America/Caracas', 'Caracas'],
  76. ['America', 'America/Curacao', 'Curacao'],
  77. ['America', 'America/Dominica', 'Dominica'],
  78. ['America', 'America/Glace_Bay', 'Glace Bay'],
  79. ['America', 'America/Goose_Bay', 'Goose Bay'],
  80. ['America', 'America/Grenada', 'Grenada'],
  81. ['America', 'America/Guadeloupe', 'Guadeloupe'],
  82. ['America', 'America/Guyana', 'Guyana'],
  83. ['America', 'America/Halifax', 'Halifax'],
  84. ['America', 'America/Kralendijk', 'Kralendijk'],
  85. ['America', 'America/La_Paz', 'La Paz'],
  86. ['America', 'America/Lower_Princes', 'Lower Princes'],
  87. ['America', 'America/Manaus', 'Manaus'],
  88. ['America', 'America/Marigot', 'Marigot'],
  89. ['America', 'America/Martinique', 'Martinique'],
  90. ['America', 'America/Moncton', 'Moncton'],
  91. ['America', 'America/Montserrat', 'Montserrat'],
  92. ['America', 'America/Port_of_Spain', 'Port of Spain'],
  93. ['America', 'America/Porto_Velho', 'Porto Velho'],
  94. ['America', 'America/Puerto_Rico', 'Puerto Rico'],
  95. ['America', 'America/Santo_Domingo', 'Santo Domingo'],
  96. ['America', 'America/St_Barthelemy', 'St Barthelemy'],
  97. ['America', 'America/St_Kitts', 'St Kitts'],
  98. ['America', 'America/St_Lucia', 'St Lucia'],
  99. ['America', 'America/St_Thomas', 'St Thomas'],
  100. ['America', 'America/St_Vincent', 'St Vincent'],
  101. ['America', 'America/Thule', 'Thule'],
  102. ['America', 'America/Tortola', 'Tortola'],
  103. ['America', 'America/Atikokan', 'Atikokan'],
  104. ['America', 'America/Bogota', 'Bogota'],
  105. ['America', 'America/Cancun', 'Cancun'],
  106. ['America', 'America/Cayman', 'Cayman'],
  107. ['America', 'America/Detroit', 'Detroit'],
  108. ['America', 'America/Eirunepe', 'Eirunepe'],
  109. ['America', 'America/Grand_Turk', 'Grand Turk'],
  110. ['America', 'America/Guayaquil', 'Guayaquil'],
  111. ['America', 'America/Havana', 'Havana'],
  112. ['America', 'America/Indiana/Indianapolis', 'Indiana / Indianapolis'],
  113. ['America', 'America/Indiana/Marengo', 'Indiana / Marengo'],
  114. ['America', 'America/Indiana/Petersburg', 'Indiana / Petersburg'],
  115. ['America', 'America/Indiana/Vevay', 'Indiana / Vevay'],
  116. ['America', 'America/Indiana/Vincennes', 'Indiana / Vincennes'],
  117. ['America', 'America/Indiana/Winamac', 'Indiana / Winamac'],
  118. ['America', 'America/Iqaluit', 'Iqaluit'],
  119. ['America', 'America/Jamaica', 'Jamaica'],
  120. ['America', 'America/Kentucky/Louisville', 'Kentucky / Louisville'],
  121. ['America', 'America/Kentucky/Monticello', 'Kentucky / Monticello'],
  122. ['America', 'America/Lima', 'Lima'],
  123. ['America', 'America/Nassau', 'Nassau'],
  124. ['America', 'America/New_York', 'New York'],
  125. ['America', 'America/Nipigon', 'Nipigon'],
  126. ['America', 'America/Panama', 'Panama'],
  127. ['America', 'America/Pangnirtung', 'Pangnirtung'],
  128. ['America', 'America/Port-au-Prince', 'Port-au-Prince'],
  129. ['America', 'America/Rio_Branco', 'Rio Branco'],
  130. ['America', 'America/Thunder_Bay', 'Thunder Bay'],
  131. ['America', 'America/Toronto', 'Toronto'],
  132. ['America', 'America/Bahia_Banderas', 'Bahia Banderas'],
  133. ['America', 'America/Belize', 'Belize'],
  134. ['America', 'America/Chicago', 'Chicago'],
  135. ['America', 'America/Costa_Rica', 'Costa Rica'],
  136. ['America', 'America/El_Salvador', 'El Salvador'],
  137. ['America', 'America/Guatemala', 'Guatemala'],
  138. ['America', 'America/Indiana/Knox', 'Indiana / Knox'],
  139. ['America', 'America/Indiana/Tell_City', 'Indiana / Tell City'],
  140. ['America', 'America/Managua', 'Managua'],
  141. ['America', 'America/Matamoros', 'Matamoros'],
  142. ['America', 'America/Menominee', 'Menominee'],
  143. ['America', 'America/Merida', 'Merida'],
  144. ['America', 'America/Mexico_City', 'Mexico City'],
  145. ['America', 'America/Monterrey', 'Monterrey'],
  146. ['America', 'America/North_Dakota/Beulah', 'North Dakota / Beulah'],
  147. ['America', 'America/North_Dakota/Center', 'North Dakota / Center'],
  148. ['America', 'America/North_Dakota/New_Salem', 'North Dakota / New Salem'],
  149. ['America', 'America/Rainy_River', 'Rainy River'],
  150. ['America', 'America/Rankin_Inlet', 'Rankin Inlet'],
  151. ['America', 'America/Regina', 'Regina'],
  152. ['America', 'America/Resolute', 'Resolute'],
  153. ['America', 'America/Swift_Current', 'Swift Current'],
  154. ['America', 'America/Tegucigalpa', 'Tegucigalpa'],
  155. ['America', 'America/Winnipeg', 'Winnipeg'],
  156. ['America', 'America/Boise', 'Boise'],
  157. ['America', 'America/Cambridge_Bay', 'Cambridge Bay'],
  158. ['America', 'America/Chihuahua', 'Chihuahua'],
  159. ['America', 'America/Creston', 'Creston'],
  160. ['America', 'America/Dawson_Creek', 'Dawson Creek'],
  161. ['America', 'America/Denver', 'Denver'],
  162. ['America', 'America/Edmonton', 'Edmonton'],
  163. ['America', 'America/Fort_Nelson', 'Fort Nelson'],
  164. ['America', 'America/Hermosillo', 'Hermosillo'],
  165. ['America', 'America/Inuvik', 'Inuvik'],
  166. ['America', 'America/Mazatlan', 'Mazatlan'],
  167. ['America', 'America/Ojinaga', 'Ojinaga'],
  168. ['America', 'America/Phoenix', 'Phoenix'],
  169. ['America', 'America/Yellowknife', 'Yellowknife'],
  170. ['America', 'America/Dawson', 'Dawson'],
  171. ['America', 'America/Los_Angeles', 'Los Angeles'],
  172. ['America', 'America/Tijuana', 'Tijuana'],
  173. ['America', 'America/Vancouver', 'Vancouver'],
  174. ['America', 'America/Whitehorse', 'Whitehorse'],
  175. ['America', 'America/Anchorage', 'Anchorage'],
  176. ['America', 'America/Juneau', 'Juneau'],
  177. ['America', 'America/Metlakatla', 'Metlakatla'],
  178. ['America', 'America/Nome', 'Nome'],
  179. ['America', 'America/Sitka', 'Sitka'],
  180. ['America', 'America/Yakutat', 'Yakutat'],
  181. ['America', 'America/Adak', 'Adak'],
  182. ['Europe', 'Europe/Dublin', 'Dublin'],
  183. ['Europe', 'Europe/Guernsey', 'Guernsey'],
  184. ['Europe', 'Europe/Isle_of_Man', 'Isle of Man'],
  185. ['Europe', 'Europe/Jersey', 'Jersey'],
  186. ['Europe', 'Europe/Lisbon', 'Lisbon'],
  187. ['Europe', 'Europe/London', 'London'],
  188. ['Europe', 'Europe/Amsterdam', 'Amsterdam'],
  189. ['Europe', 'Europe/Andorra', 'Andorra'],
  190. ['Europe', 'Europe/Belgrade', 'Belgrade'],
  191. ['Europe', 'Europe/Berlin', 'Berlin'],
  192. ['Europe', 'Europe/Bratislava', 'Bratislava'],
  193. ['Europe', 'Europe/Brussels', 'Brussels'],
  194. ['Europe', 'Europe/Budapest', 'Budapest'],
  195. ['Europe', 'Europe/Busingen', 'Busingen'],
  196. ['Europe', 'Europe/Copenhagen', 'Copenhagen'],
  197. ['Europe', 'Europe/Gibraltar', 'Gibraltar'],
  198. ['Europe', 'Europe/Ljubljana', 'Ljubljana'],
  199. ['Europe', 'Europe/Luxembourg', 'Luxembourg'],
  200. ['Europe', 'Europe/Madrid', 'Madrid'],
  201. ['Europe', 'Europe/Malta', 'Malta'],
  202. ['Europe', 'Europe/Monaco', 'Monaco'],
  203. ['Europe', 'Europe/Oslo', 'Oslo'],
  204. ['Europe', 'Europe/Paris', 'Paris'],
  205. ['Europe', 'Europe/Podgorica', 'Podgorica'],
  206. ['Europe', 'Europe/Prague', 'Prague'],
  207. ['Europe', 'Europe/Rome', 'Rome'],
  208. ['Europe', 'Europe/San_Marino', 'San Marino'],
  209. ['Europe', 'Europe/Sarajevo', 'Sarajevo'],
  210. ['Europe', 'Europe/Skopje', 'Skopje'],
  211. ['Europe', 'Europe/Stockholm', 'Stockholm'],
  212. ['Europe', 'Europe/Tirane', 'Tirane'],
  213. ['Europe', 'Europe/Vaduz', 'Vaduz'],
  214. ['Europe', 'Europe/Vatican', 'Vatican'],
  215. ['Europe', 'Europe/Vienna', 'Vienna'],
  216. ['Europe', 'Europe/Warsaw', 'Warsaw'],
  217. ['Europe', 'Europe/Zagreb', 'Zagreb'],
  218. ['Europe', 'Europe/Zurich', 'Zurich'],
  219. ['Europe', 'Europe/Athens', 'Athens'],
  220. ['Europe', 'Europe/Bucharest', 'Bucharest'],
  221. ['Europe', 'Europe/Chisinau', 'Chisinau'],
  222. ['Europe', 'Europe/Helsinki', 'Helsinki'],
  223. ['Europe', 'Europe/Kaliningrad', 'Kaliningrad'],
  224. ['Europe', 'Europe/Mariehamn', 'Mariehamn'],
  225. ['Europe', 'Europe/Riga', 'Riga'],
  226. ['Europe', 'Europe/Sofia', 'Sofia'],
  227. ['Europe', 'Europe/Tallinn', 'Tallinn'],
  228. ['Europe', 'Europe/Uzhgorod', 'Uzhgorod'],
  229. ['Europe', 'Europe/Vilnius', 'Vilnius'],
  230. ['Europe', 'Europe/Zaporozhye', 'Zaporozhye'],
  231. ['Europe', 'Europe/Istanbul', 'Istanbul'],
  232. ['Europe', 'Europe/Kyiv', 'Kyiv'],
  233. ['Europe', 'Europe/Minsk', 'Minsk'],
  234. ['Europe', 'Europe/Moscow', 'Moscow'],
  235. ['Europe', 'Europe/Simferopol', 'Simferopol'],
  236. ['Europe', 'Europe/Samara', 'Samara'],
  237. ['Europe', 'Europe/Volgograd', 'Volgograd'],
  238. ['Asia', 'Asia/Amman', 'Amman'],
  239. ['Asia', 'Asia/Beirut', 'Beirut'],
  240. ['Asia', 'Asia/Damascus', 'Damascus'],
  241. ['Asia', 'Asia/Gaza', 'Gaza'],
  242. ['Asia', 'Asia/Hebron', 'Hebron'],
  243. ['Asia', 'Asia/Jerusalem', 'Jerusalem'],
  244. ['Asia', 'Asia/Nicosia', 'Nicosia'],
  245. ['Asia', 'Asia/Aden', 'Aden'],
  246. ['Asia', 'Asia/Baghdad', 'Baghdad'],
  247. ['Asia', 'Asia/Bahrain', 'Bahrain'],
  248. ['Asia', 'Asia/Kuwait', 'Kuwait'],
  249. ['Asia', 'Asia/Qatar', 'Qatar'],
  250. ['Asia', 'Asia/Riyadh', 'Riyadh'],
  251. ['Asia', 'Asia/Tehran', 'Tehran'],
  252. ['Asia', 'Asia/Baku', 'Baku'],
  253. ['Asia', 'Asia/Dubai', 'Dubai'],
  254. ['Asia', 'Asia/Muscat', 'Muscat'],
  255. ['Asia', 'Asia/Tbilisi', 'Tbilisi'],
  256. ['Asia', 'Asia/Yerevan', 'Yerevan'],
  257. ['Asia', 'Asia/Kabul', 'Kabul'],
  258. ['Asia', 'Asia/Aqtau', 'Aqtau'],
  259. ['Asia', 'Asia/Aqtobe', 'Aqtobe'],
  260. ['Asia', 'Asia/Ashgabat', 'Ashgabat'],
  261. ['Asia', 'Asia/Dushanbe', 'Dushanbe'],
  262. ['Asia', 'Asia/Karachi', 'Karachi'],
  263. ['Asia', 'Asia/Oral', 'Oral'],
  264. ['Asia', 'Asia/Samarkand', 'Samarkand'],
  265. ['Asia', 'Asia/Tashkent', 'Tashkent'],
  266. ['Asia', 'Asia/Yekaterinburg', 'Yekaterinburg'],
  267. ['Asia', 'Asia/Colombo', 'Colombo'],
  268. ['Asia', 'Asia/Kolkata', 'Kolkata'],
  269. ['Asia', 'Asia/Kathmandu', 'Kathmandu'],
  270. ['Asia', 'Asia/Almaty', 'Almaty'],
  271. ['Asia', 'Asia/Bishkek', 'Bishkek'],
  272. ['Asia', 'Asia/Dhaka', 'Dhaka'],
  273. ['Asia', 'Asia/Novosibirsk', 'Novosibirsk'],
  274. ['Asia', 'Asia/Omsk', 'Omsk'],
  275. ['Asia', 'Asia/Qyzylorda', 'Qyzylorda'],
  276. ['Asia', 'Asia/Thimphu', 'Thimphu'],
  277. ['Asia', 'Asia/Urumqi', 'Urumqi'],
  278. ['Asia', 'Asia/Rangoon', 'Rangoon'],
  279. ['Asia', 'Asia/Bangkok', 'Bangkok'],
  280. ['Asia', 'Asia/Ho_Chi_Minh', 'Ho Chi Minh'],
  281. ['Asia', 'Asia/Hovd', 'Hovd'],
  282. ['Asia', 'Asia/Jakarta', 'Jakarta'],
  283. ['Asia', 'Asia/Krasnoyarsk', 'Krasnoyarsk'],
  284. ['Asia', 'Asia/Novokuznetsk', 'Novokuznetsk'],
  285. ['Asia', 'Asia/Phnom_Penh', 'Phnom Penh'],
  286. ['Asia', 'Asia/Pontianak', 'Pontianak'],
  287. ['Asia', 'Asia/Vientiane', 'Vientiane'],
  288. ['Asia', 'Asia/Brunei', 'Brunei'],
  289. ['Asia', 'Asia/Choibalsan', 'Choibalsan'],
  290. ['Asia', 'Asia/Hong_Kong', 'Hong Kong'],
  291. ['Asia', 'Asia/Irkutsk', 'Irkutsk'],
  292. ['Asia', 'Asia/Kuala_Lumpur', 'Kuala Lumpur'],
  293. ['Asia', 'Asia/Kuching', 'Kuching'],
  294. ['Asia', 'Asia/Macau', 'Macau'],
  295. ['Asia', 'Asia/Makassar', 'Makassar'],
  296. ['Asia', 'Asia/Manila', 'Manila'],
  297. ['Asia', 'Asia/Shanghai', 'Shanghai'],
  298. ['Asia', 'Asia/Singapore', 'Singapore'],
  299. ['Asia', 'Asia/Taipei', 'Taipei'],
  300. ['Asia', 'Asia/Ulaanbaatar', 'Ulaanbaatar'],
  301. ['Asia', 'Asia/Chita', 'Chita'],
  302. ['Asia', 'Asia/Dili', 'Dili'],
  303. ['Asia', 'Asia/Jayapura', 'Jayapura'],
  304. ['Asia', 'Asia/Khandyga', 'Khandyga'],
  305. ['Asia', 'Asia/Pyongyang', 'Pyongyang'],
  306. ['Asia', 'Asia/Seoul', 'Seoul'],
  307. ['Asia', 'Asia/Tokyo', 'Tokyo'],
  308. ['Asia', 'Asia/Yakutsk', 'Yakutsk'],
  309. ['Asia', 'Asia/Magadan', 'Magadan'],
  310. ['Asia', 'Asia/Sakhalin', 'Sakhalin'],
  311. ['Asia', 'Asia/Ust-Nera', 'Ust-Nera'],
  312. ['Asia', 'Asia/Vladivostok', 'Vladivostok'],
  313. ['Asia', 'Asia/Srednekolymsk', 'Srednekolymsk'],
  314. ['Asia', 'Asia/Anadyr', 'Anadyr'],
  315. ['Asia', 'Asia/Kamchatka', 'Kamchatka'],
  316. ['Australia', 'Australia/Perth', 'Perth'],
  317. ['Australia', 'Australia/Eucla', 'Eucla'],
  318. ['Australia', 'Australia/Darwin', 'Darwin'],
  319. ['Australia', 'Australia/Brisbane', 'Brisbane'],
  320. ['Australia', 'Australia/Lindeman', 'Lindeman'],
  321. ['Australia', 'Australia/Adelaide', 'Adelaide'],
  322. ['Australia', 'Australia/Broken_Hill', 'Broken Hill'],
  323. ['Australia', 'Australia/Currie', 'Currie'],
  324. ['Australia', 'Australia/Hobart', 'Hobart'],
  325. ['Australia', 'Australia/Lord_Howe', 'Lord_Howe'],
  326. ['Australia', 'Australia/Melbourne', 'Melbourne'],
  327. ['Australia', 'Australia/Sydney', 'Sydney'],
  328. ['Indian', 'Indian/Antananarivo', 'Antananarivo'],
  329. ['Indian', 'Indian/Comoro', 'Comoro'],
  330. ['Indian', 'Indian/Mayotte', 'Mayotte'],
  331. ['Indian', 'Indian/Mahe', 'Mahe'],
  332. ['Indian', 'Indian/Mauritius', 'Mauritius'],
  333. ['Indian', 'Indian/Reunion', 'Reunion'],
  334. ['Indian', 'Indian/Kerguelen', 'Kerguelen'],
  335. ['Indian', 'Indian/Maldives', 'Maldives'],
  336. ['Indian', 'Indian/Chagos', 'Chagos'],
  337. ['Indian', 'Indian/Cocos', 'Cocos'],
  338. ['Indian', 'Indian/Christmas', 'Christmas'],
  339. ['Africa', 'Africa/Abidjan', 'Abidjan'],
  340. ['Africa', 'Africa/Accra', 'Accra'],
  341. ['Africa', 'Africa/Bamako', 'Bamako'],
  342. ['Africa', 'Africa/Banjul', 'Banjul'],
  343. ['Africa', 'Africa/Bissau', 'Bissau'],
  344. ['Africa', 'Africa/Casablanca', 'Casablanca'],
  345. ['Africa', 'Africa/Conakry', 'Conakry'],
  346. ['Africa', 'Africa/Dakar', 'Dakar'],
  347. ['Africa', 'Africa/El_Aaiun', 'El Aaiun'],
  348. ['Africa', 'Africa/Freetown', 'Freetown'],
  349. ['Africa', 'Africa/Lome', 'Lome'],
  350. ['Africa', 'Africa/Monrovia', 'Monrovia'],
  351. ['Africa', 'Africa/Nouakchott', 'Nouakchott'],
  352. ['Africa', 'Africa/Ouagadougou', 'Ouagadougou'],
  353. ['Africa', 'Africa/Sao_Tome', 'Sao Tome'],
  354. ['Africa', 'Africa/Algiers', 'Algiers'],
  355. ['Africa', 'Africa/Bangui', 'Bangui'],
  356. ['Africa', 'Africa/Brazzaville', 'Brazzaville'],
  357. ['Africa', 'Africa/Ceuta', 'Ceuta'],
  358. ['Africa', 'Africa/Douala', 'Douala'],
  359. ['Africa', 'Africa/Kinshasa', 'Kinshasa'],
  360. ['Africa', 'Africa/Lagos', 'Lagos'],
  361. ['Africa', 'Africa/Libreville', 'Libreville'],
  362. ['Africa', 'Africa/Luanda', 'Luanda'],
  363. ['Africa', 'Africa/Malabo', 'Malabo'],
  364. ['Africa', 'Africa/Ndjamena', 'Ndjamena'],
  365. ['Africa', 'Africa/Niamey', 'Niamey'],
  366. ['Africa', 'Africa/Porto-Novo', 'Porto-Novo'],
  367. ['Africa', 'Africa/Tunis', 'Tunis'],
  368. ['Africa', 'Africa/Blantyre', 'Blantyre'],
  369. ['Africa', 'Africa/Bujumbura', 'Bujumbura'],
  370. ['Africa', 'Africa/Cairo', 'Cairo'],
  371. ['Africa', 'Africa/Gaborone', 'Gaborone'],
  372. ['Africa', 'Africa/Harare', 'Harare'],
  373. ['Africa', 'Africa/Johannesburg', 'Johannesburg'],
  374. ['Africa', 'Africa/Juba', 'Juba'],
  375. ['Africa', 'Africa/Khartoum', 'Khartoum'],
  376. ['Africa', 'Africa/Kigali', 'Kigali'],
  377. ['Africa', 'Africa/Lubumbashi', 'Lubumbashi'],
  378. ['Africa', 'Africa/Lusaka', 'Lusaka'],
  379. ['Africa', 'Africa/Maputo', 'Maputo'],
  380. ['Africa', 'Africa/Maseru', 'Maseru'],
  381. ['Africa', 'Africa/Mbabane', 'Mbabane'],
  382. ['Africa', 'Africa/Tripoli', 'Tripoli'],
  383. ['Africa', 'Africa/Windhoek', 'Windhoek'],
  384. ['Africa', 'Africa/Addis_Ababa', 'Addis Ababa'],
  385. ['Africa', 'Africa/Asmara', 'Asmara'],
  386. ['Africa', 'Africa/Dar_es_Salaam', 'Dar es Salaam'],
  387. ['Africa', 'Africa/Djibouti', 'Djibouti'],
  388. ['Africa', 'Africa/Kampala', 'Kampala'],
  389. ['Africa', 'Africa/Mogadishu', 'Mogadishu'],
  390. ['Africa', 'Africa/Nairobi', 'Nairobi'],
  391. ['Pacific', 'Pacific/Palau', 'Palau'],
  392. ['Pacific', 'Pacific/Chuuk', 'Chuuk'],
  393. ['Pacific', 'Pacific/Guam', 'Guam'],
  394. ['Pacific', 'Pacific/Port_Moresby', 'Port Moresby'],
  395. ['Pacific', 'Pacific/Saipan', 'Saipan'],
  396. ['Pacific', 'Pacific/Bougainville', 'Bougainville'],
  397. ['Pacific', 'Pacific/Efate', 'Efate'],
  398. ['Pacific', 'Pacific/Guadalcanal', 'Guadalcanal'],
  399. ['Pacific', 'Pacific/Kosrae', 'Kosrae'],
  400. ['Pacific', 'Pacific/Norfolk', 'Norfolk'],
  401. ['Pacific', 'Pacific/Noumea', 'Noumea'],
  402. ['Pacific', 'Pacific/Pohnpei', 'Pohnpei'],
  403. ['Pacific', 'Pacific/Funafuti', 'Funafuti'],
  404. ['Pacific', 'Pacific/Kwajalein', 'Kwajalein'],
  405. ['Pacific', 'Pacific/Majuro', 'Majuro'],
  406. ['Pacific', 'Pacific/Nauru', 'Nauru'],
  407. ['Pacific', 'Pacific/Tarawa', 'Tarawa'],
  408. ['Pacific', 'Pacific/Wake', 'Wake'],
  409. ['Pacific', 'Pacific/Wallis', 'Wallis'],
  410. ['Pacific', 'Pacific/Auckland', 'Auckland'],
  411. ['Pacific', 'Pacific/Enderbury', 'Enderbury'],
  412. ['Pacific', 'Pacific/Fakaofo', 'Fakaofo'],
  413. ['Pacific', 'Pacific/Fiji', 'Fiji'],
  414. ['Pacific', 'Pacific/Tongatapu', 'Tongatapu'],
  415. ['Pacific', 'Pacific/Chatham', 'Chatham'],
  416. ['Pacific', 'Pacific/Apia', 'Apia'],
  417. ['Pacific', 'Pacific/Kiritimati', 'Kiritimati'],
  418. ['Pacific', 'Pacific/Easter', 'Easter'],
  419. ['Pacific', 'Pacific/Galapagos', 'Galapagos'],
  420. ['Pacific', 'Pacific/Pitcairn', 'Pitcairn'],
  421. ['Pacific', 'Pacific/Gambier', 'Gambier'],
  422. ['Pacific', 'Pacific/Marquesas', 'Marquesas'],
  423. ['Pacific', 'Pacific/Honolulu', 'Honolulu'],
  424. ['Pacific', 'Pacific/Johnston', 'Johnston'],
  425. ['Pacific', 'Pacific/Rarotonga', 'Rarotonga'],
  426. ['Pacific', 'Pacific/Tahiti', 'Tahiti'],
  427. ['Pacific', 'Pacific/Midway', 'Midway'],
  428. ['Pacific', 'Pacific/Niue', 'Niue'],
  429. ['Pacific', 'Pacific/Pago_Pago', 'Pago Pago'],
  430. ['Atlantic', 'Atlantic/Canary', 'Canary'],
  431. ['Atlantic', 'Atlantic/Faroe', 'Faroe'],
  432. ['Atlantic', 'Atlantic/Madeira', 'Madeira'],
  433. ['Atlantic', 'Atlantic/Reykjavik', 'Reykjavik'],
  434. ['Atlantic', 'Atlantic/St_Helena', 'St Helena'],
  435. ['Atlantic', 'Atlantic/Azores', 'Azores'],
  436. ['Atlantic', 'Atlantic/Cape_Verde', 'Cape Verde'],
  437. ['Atlantic', 'Atlantic/South_Georgia', 'South Georgia'],
  438. ['Atlantic', 'Atlantic/Stanley', 'Stanley'],
  439. ['Atlantic', 'Atlantic/Bermuda', 'Bermuda'],
  440. ['Antarctica', 'Antarctica/Troll', 'Troll'],
  441. ['Antarctica', 'Antarctica/Syowa', 'Syowa'],
  442. ['Antarctica', 'Antarctica/Mawson', 'Mawson'],
  443. ['Antarctica', 'Antarctica/Vostok', 'Vostok'],
  444. ['Antarctica', 'Antarctica/Davis', 'Davis'],
  445. ['Antarctica', 'Antarctica/Casey', 'Casey'],
  446. ['Antarctica', 'Antarctica/DumontDUrville', 'DumontDUrville'],
  447. ['Antarctica', 'Antarctica/Macquarie', 'Macquarie'],
  448. ['Antarctica', 'Antarctica/McMurdo', 'McMurdo'],
  449. ['Antarctica', 'Antarctica/Palmer', 'Palmer'],
  450. ['Antarctica', 'Antarctica/Rothera', 'Rothera'],
  451. ['Arctic', 'Arctic/Longyearbyen', 'Longyearbyen'],
  452. ];
  453. const OffsetLabel = styled('div')`
  454. color: ${p => p.theme.subText};
  455. font-weight: ${p => p.theme.fontWeightBold};
  456. display: flex;
  457. align-items: center;
  458. font-size: ${p => p.theme.fontSizeSmall};
  459. width: max-content;
  460. `;
  461. const groupedTimezones = Object.entries(groupBy(timezones, ([group]) => group));
  462. // @ts-expect-error Should be removed once these types improve for grouped options
  463. const timezoneOptions: SelectValue<string>[] = groupedTimezones.map(([group, zones]) => ({
  464. label: group,
  465. options: zones.map(([_, value, label]) => {
  466. const offsetLabel = moment.tz(value).format('Z');
  467. return {
  468. value,
  469. trailingItems: <OffsetLabel>UTC {offsetLabel}</OffsetLabel>,
  470. label,
  471. textValue: `${group} ${label} ${offsetLabel}`,
  472. };
  473. }),
  474. }));
  475. export {timezones, timezoneOptions};