timezones-ical-library 1.4.2 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +1 -0
- package/{npm_dist → dist}/cjs/.eslintrc.json +0 -0
- package/dist/cjs/index.js +947 -0
- package/{npm_dist → dist}/cjs/package.json +0 -0
- package/dist/mjs/index.js +947 -0
- package/{npm_dist → dist}/mjs/package.json +0 -0
- package/dist/tzlib.js +2 -199
- package/index.d.ts +3 -3
- package/package.json +17 -13
- package/test/load-commonjs.cjs +1 -1
- package/test/load-module.mjs +1 -1
- package/test/tests.js +2 -2
- package/.eslintrc.json +0 -39
- package/npm_dist/cjs/index.js +0 -212
- package/npm_dist/mjs/index.js +0 -212
|
@@ -0,0 +1,947 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @preserve
|
|
3
|
+
*
|
|
4
|
+
* ++++++++++++++++++++++++++++++++++++++
|
|
5
|
+
* Add to Calendar TimeZones iCal Library
|
|
6
|
+
* ++++++++++++++++++++++++++++++++++++++
|
|
7
|
+
*
|
|
8
|
+
* Version: 1.5.1
|
|
9
|
+
* Creator: Jens Kuerschner (https://jenskuerschner.de)
|
|
10
|
+
* Project: https://github.com/add2cal/timezones-ical-library
|
|
11
|
+
* License: Apache-2.0
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
+
const tzlibVersion = '1.5.1';
|
|
16
|
+
const tzlibZonesDB = {
|
|
17
|
+
Africa: {
|
|
18
|
+
Abidjan: ['', 0],
|
|
19
|
+
Accra: ['Africa/Abidjan', 0],
|
|
20
|
+
Addis_Ababa: ['Africa/Nairobi', 1],
|
|
21
|
+
Algiers: ['', 2],
|
|
22
|
+
Asmara: ['Africa/Nairobi', 1],
|
|
23
|
+
Asmera: ['Africa/Nairobi', 1],
|
|
24
|
+
Bamako: ['Africa/Abidjan', 0],
|
|
25
|
+
Bangui: ['Africa/Lagos', 3],
|
|
26
|
+
Banjul: ['Africa/Abidjan', 0],
|
|
27
|
+
Bissau: ['', 0],
|
|
28
|
+
Blantyre: ['Africa/Maputo', 4],
|
|
29
|
+
Brazzaville: ['Africa/Lagos', 3],
|
|
30
|
+
Bujumbura: ['Africa/Maputo', 4],
|
|
31
|
+
Cairo: ['', 5],
|
|
32
|
+
Casablanca: ['', 6],
|
|
33
|
+
Ceuta: ['', 7],
|
|
34
|
+
Conakry: ['Africa/Abidjan', 0],
|
|
35
|
+
Dakar: ['Africa/Abidjan', 0],
|
|
36
|
+
Dar_es_Salaam: ['Africa/Nairobi', 1],
|
|
37
|
+
Djibouti: ['Africa/Nairobi', 1],
|
|
38
|
+
Douala: ['Africa/Lagos', 3],
|
|
39
|
+
El_Aaiun: ['', 6],
|
|
40
|
+
Freetown: ['Africa/Abidjan', 0],
|
|
41
|
+
Gaborone: ['Africa/Maputo', 4],
|
|
42
|
+
Harare: ['Africa/Maputo', 4],
|
|
43
|
+
Johannesburg: ['', 8],
|
|
44
|
+
Juba: ['', 4],
|
|
45
|
+
Kampala: ['Africa/Nairobi', 1],
|
|
46
|
+
Khartoum: ['', 4],
|
|
47
|
+
Kigali: ['Africa/Maputo', 4],
|
|
48
|
+
Kinshasa: ['Africa/Lagos', 3],
|
|
49
|
+
Lagos: ['', 3],
|
|
50
|
+
Libreville: ['Africa/Lagos', 3],
|
|
51
|
+
Lome: ['Africa/Abidjan', 0],
|
|
52
|
+
Luanda: ['Africa/Lagos', 3],
|
|
53
|
+
Lubumbashi: ['Africa/Maputo', 4],
|
|
54
|
+
Lusaka: ['Africa/Maputo', 4],
|
|
55
|
+
Malabo: ['Africa/Lagos', 3],
|
|
56
|
+
Maputo: ['', 4],
|
|
57
|
+
Maseru: ['Africa/Johannesburg', 8],
|
|
58
|
+
Mbabane: ['Africa/Johannesburg', 8],
|
|
59
|
+
Mogadishu: ['Africa/Nairobi', 1],
|
|
60
|
+
Monrovia: ['', 0],
|
|
61
|
+
Nairobi: ['', 1],
|
|
62
|
+
Ndjamena: ['', 3],
|
|
63
|
+
Niamey: ['Africa/Lagos', 3],
|
|
64
|
+
Nouakchott: ['Africa/Abidjan', 0],
|
|
65
|
+
Ouagadougou: ['Africa/Abidjan', 0],
|
|
66
|
+
'Porto-Novo': ['Africa/Lagos', 3],
|
|
67
|
+
Sao_Tome: ['', 0],
|
|
68
|
+
Timbuktu: ['Africa/Abidjan', 0],
|
|
69
|
+
Tripoli: ['', 5],
|
|
70
|
+
Tunis: ['', 2],
|
|
71
|
+
Windhoek: ['', 4],
|
|
72
|
+
},
|
|
73
|
+
America: {
|
|
74
|
+
Adak: ['', 9],
|
|
75
|
+
Anchorage: ['', 10],
|
|
76
|
+
Anguilla: ['America/Puerto_Rico', 11],
|
|
77
|
+
Antigua: ['America/Puerto_Rico', 11],
|
|
78
|
+
Araguaina: ['', 12],
|
|
79
|
+
Argentina: {
|
|
80
|
+
Buenos_Aires: ['', 12],
|
|
81
|
+
Catamarca: ['', 12],
|
|
82
|
+
ComodRivadavia: ['America/Argentina/Catamarca', 12],
|
|
83
|
+
Cordoba: ['', 12],
|
|
84
|
+
Jujuy: ['', 12],
|
|
85
|
+
La_Rioja: ['', 12],
|
|
86
|
+
Mendoza: ['', 12],
|
|
87
|
+
Rio_Gallegos: ['', 12],
|
|
88
|
+
Salta: ['', 12],
|
|
89
|
+
San_Juan: ['', 12],
|
|
90
|
+
San_Luis: ['', 12],
|
|
91
|
+
Tucuman: ['', 12],
|
|
92
|
+
Ushuaia: ['', 12],
|
|
93
|
+
},
|
|
94
|
+
Aruba: ['America/Puerto_Rico', 11],
|
|
95
|
+
Asuncion: ['', 13],
|
|
96
|
+
Atikokan: ['America/Panama', 14],
|
|
97
|
+
Atka: ['America/Adak', 9],
|
|
98
|
+
Bahia_Banderas: ['', 15],
|
|
99
|
+
Bahia: ['', 12],
|
|
100
|
+
Barbados: ['', 11],
|
|
101
|
+
Belem: ['', 12],
|
|
102
|
+
Belize: ['', 16],
|
|
103
|
+
'Blanc-Sablon': ['America/Puerto_Rico', 11],
|
|
104
|
+
Boa_Vista: ['', 17],
|
|
105
|
+
Bogota: ['', 18],
|
|
106
|
+
Boise: ['', 19],
|
|
107
|
+
Buenos_Aires: ['America/Argentina/Buenos_Aires', 12],
|
|
108
|
+
Cambridge_Bay: ['', 19],
|
|
109
|
+
Campo_Grande: ['', 17],
|
|
110
|
+
Cancun: ['', 14],
|
|
111
|
+
Caracas: ['', 17],
|
|
112
|
+
Catamarca: ['America/Argentina/Catamarca', 12],
|
|
113
|
+
Cayenne: ['', 12],
|
|
114
|
+
Cayman: ['America/Panama', 14],
|
|
115
|
+
Chicago: ['', 20],
|
|
116
|
+
Chihuahua: ['', 21],
|
|
117
|
+
Coral_Harbour: ['America/Panama', 14],
|
|
118
|
+
Cordoba: ['America/Argentina/Cordoba', 12],
|
|
119
|
+
Costa_Rica: ['', 16],
|
|
120
|
+
Creston: ['America/Phoenix', 22],
|
|
121
|
+
Cuiaba: ['', 17],
|
|
122
|
+
Curacao: ['America/Puerto_Rico', 11],
|
|
123
|
+
Danmarkshavn: ['', 0],
|
|
124
|
+
Dawson_Creek: ['', 22],
|
|
125
|
+
Dawson: ['', 22],
|
|
126
|
+
Denver: ['', 19],
|
|
127
|
+
Detroit: ['', 23],
|
|
128
|
+
Dominica: ['America/Puerto_Rico', 11],
|
|
129
|
+
Edmonton: ['', 19],
|
|
130
|
+
Eirunepe: ['', 18],
|
|
131
|
+
El_Salvador: ['', 16],
|
|
132
|
+
Ensenada: ['America/Tijuana', 24],
|
|
133
|
+
Fort_Nelson: ['', 22],
|
|
134
|
+
Fort_Wayne: ['America/Indiana/Indianapolis', 23],
|
|
135
|
+
Fortaleza: ['', 12],
|
|
136
|
+
Glace_Bay: ['', 25],
|
|
137
|
+
Godthab: ['America/Nuuk', 26],
|
|
138
|
+
Goose_Bay: ['', 27],
|
|
139
|
+
Grand_Turk: ['', 28],
|
|
140
|
+
Grenada: ['America/Puerto_Rico', 11],
|
|
141
|
+
Guadeloupe: ['America/Puerto_Rico', 11],
|
|
142
|
+
Guatemala: ['', 16],
|
|
143
|
+
Guayaquil: ['', 18],
|
|
144
|
+
Guyana: ['', 17],
|
|
145
|
+
Halifax: ['', 25],
|
|
146
|
+
Havana: ['', 29],
|
|
147
|
+
Hermosillo: ['', 22],
|
|
148
|
+
Indiana: {
|
|
149
|
+
Indianapolis: ['', 23],
|
|
150
|
+
Knox: ['', 20],
|
|
151
|
+
Marengo: ['', 23],
|
|
152
|
+
Petersburg: ['', 23],
|
|
153
|
+
Tell_City: ['', 20],
|
|
154
|
+
Vevay: ['', 23],
|
|
155
|
+
Vincennes: ['', 23],
|
|
156
|
+
Winamac: ['', 28],
|
|
157
|
+
},
|
|
158
|
+
Indianapolis: ['America/Indiana/Indianapolis', 23],
|
|
159
|
+
Inuvik: ['', 19],
|
|
160
|
+
Iqaluit: ['', 23],
|
|
161
|
+
Jamaica: ['', 14],
|
|
162
|
+
Jujuy: ['America/Argentina/Jujuy', 12],
|
|
163
|
+
Juneau: ['', 10],
|
|
164
|
+
Kentucky: { Louisville: ['', 23], Monticello: ['', 23] },
|
|
165
|
+
Knox_IN: ['America/Indiana/Knox', 20],
|
|
166
|
+
Kralendijk: ['America/Puerto_Rico', 11],
|
|
167
|
+
La_Paz: ['', 17],
|
|
168
|
+
Lima: ['', 18],
|
|
169
|
+
Los_Angeles: ['', 24],
|
|
170
|
+
Louisville: ['America/Kentucky/Louisville', 23],
|
|
171
|
+
Lower_Princes: ['America/Puerto_Rico', 11],
|
|
172
|
+
Maceio: ['', 12],
|
|
173
|
+
Managua: ['', 16],
|
|
174
|
+
Manaus: ['', 17],
|
|
175
|
+
Marigot: ['America/Puerto_Rico', 11],
|
|
176
|
+
Martinique: ['', 11],
|
|
177
|
+
Matamoros: ['', 20],
|
|
178
|
+
Mazatlan: ['', 21],
|
|
179
|
+
Mendoza: ['America/Argentina/Mendoza', 12],
|
|
180
|
+
Menominee: ['', 20],
|
|
181
|
+
Merida: ['', 30],
|
|
182
|
+
Metlakatla: ['', 10],
|
|
183
|
+
Mexico_City: ['', 30],
|
|
184
|
+
Miquelon: ['', 31],
|
|
185
|
+
Moncton: ['', 25],
|
|
186
|
+
Monterrey: ['', 30],
|
|
187
|
+
Montevideo: ['', 12],
|
|
188
|
+
Montreal: ['America/Toronto', 23],
|
|
189
|
+
Montserrat: ['America/Puerto_Rico', 11],
|
|
190
|
+
Nassau: ['America/Toronto', 23],
|
|
191
|
+
New_York: ['', 23],
|
|
192
|
+
Nipigon: ['', 23],
|
|
193
|
+
Nome: ['', 10],
|
|
194
|
+
Noronha: ['', 32],
|
|
195
|
+
North_Dakota: { Beulah: ['', 20], Center: ['', 20], New_Salem: ['', 20] },
|
|
196
|
+
Nuuk: ['', 26],
|
|
197
|
+
Ojinaga: ['', 19],
|
|
198
|
+
Panama: ['', 14],
|
|
199
|
+
Pangnirtung: ['', 23],
|
|
200
|
+
Paramaribo: ['', 12],
|
|
201
|
+
Phoenix: ['', 22],
|
|
202
|
+
Port_of_Spain: ['America/Puerto_Rico', 11],
|
|
203
|
+
'Port-au-Prince': ['', 23],
|
|
204
|
+
Porto_Acre: ['America/Rio_Branco', 18],
|
|
205
|
+
Porto_Velho: ['', 17],
|
|
206
|
+
Puerto_Rico: ['', 11],
|
|
207
|
+
Punta_Arenas: ['', 12],
|
|
208
|
+
Rainy_River: ['', 20],
|
|
209
|
+
Rankin_Inlet: ['', 20],
|
|
210
|
+
Recife: ['', 12],
|
|
211
|
+
Regina: ['', 16],
|
|
212
|
+
Resolute: ['', 33],
|
|
213
|
+
Rio_Branco: ['', 18],
|
|
214
|
+
Rosario: ['America/Argentina/Cordoba', 12],
|
|
215
|
+
Santa_Isabel: ['America/Tijuana', 24],
|
|
216
|
+
Santarem: ['', 12],
|
|
217
|
+
Santiago: ['', 34],
|
|
218
|
+
Santo_Domingo: ['', 11],
|
|
219
|
+
Sao_Paulo: ['', 12],
|
|
220
|
+
Scoresbysund: ['', 35],
|
|
221
|
+
Shiprock: ['America/Denver', 19],
|
|
222
|
+
Sitka: ['', 10],
|
|
223
|
+
St_Barthelemy: ['America/Puerto_Rico', 11],
|
|
224
|
+
St_Johns: ['', 36],
|
|
225
|
+
St_Kitts: ['America/Puerto_Rico', 11],
|
|
226
|
+
St_Lucia: ['America/Puerto_Rico', 11],
|
|
227
|
+
St_Thomas: ['America/Puerto_Rico', 11],
|
|
228
|
+
St_Vincent: ['America/Puerto_Rico', 11],
|
|
229
|
+
Swift_Current: ['', 16],
|
|
230
|
+
Tegucigalpa: ['', 16],
|
|
231
|
+
Thule: ['', 25],
|
|
232
|
+
Thunder_Bay: ['', 23],
|
|
233
|
+
Tijuana: ['', 24],
|
|
234
|
+
Toronto: ['', 23],
|
|
235
|
+
Tortola: ['America/Puerto_Rico', 11],
|
|
236
|
+
Vancouver: ['', 24],
|
|
237
|
+
Virgin: ['America/Puerto_Rico', 11],
|
|
238
|
+
Whitehorse: ['', 22],
|
|
239
|
+
Winnipeg: ['', 20],
|
|
240
|
+
Yakutat: ['', 10],
|
|
241
|
+
Yellowknife: ['', 19],
|
|
242
|
+
},
|
|
243
|
+
Antarctica: {
|
|
244
|
+
Casey: ['', 37],
|
|
245
|
+
Davis: ['', 38],
|
|
246
|
+
DumontDUrville: ['Pacific/Port_Moresby', 39],
|
|
247
|
+
Macquarie: ['', 40],
|
|
248
|
+
Mawson: ['', 41],
|
|
249
|
+
McMurdo: ['Pacific/Auckland', 42],
|
|
250
|
+
Palmer: ['', 12],
|
|
251
|
+
Rothera: ['', 12],
|
|
252
|
+
South_Pole: ['Pacific/Auckland', 42],
|
|
253
|
+
Syowa: ['Asia/Riyadh', 43],
|
|
254
|
+
Troll: ['', 44],
|
|
255
|
+
Vostok: ['Asia/Urumqi', 45],
|
|
256
|
+
},
|
|
257
|
+
Arctic: { Longyearbyen: ['Europe/Berlin', 7] },
|
|
258
|
+
Asia: {
|
|
259
|
+
Aden: ['Asia/Riyadh', 43],
|
|
260
|
+
Almaty: ['', 45],
|
|
261
|
+
Amman: ['', 43],
|
|
262
|
+
Anadyr: ['', 46],
|
|
263
|
+
Aqtau: ['', 41],
|
|
264
|
+
Aqtobe: ['', 41],
|
|
265
|
+
Ashgabat: ['', 41],
|
|
266
|
+
Ashkhabad: ['Asia/Ashgabat', 41],
|
|
267
|
+
Atyrau: ['', 41],
|
|
268
|
+
Baghdad: ['', 43],
|
|
269
|
+
Bahrain: ['Asia/Qatar', 43],
|
|
270
|
+
Baku: ['', 47],
|
|
271
|
+
Bangkok: ['', 38],
|
|
272
|
+
Barnaul: ['', 38],
|
|
273
|
+
Beirut: ['', 48],
|
|
274
|
+
Bishkek: ['', 45],
|
|
275
|
+
Brunei: ['Asia/Kuching', 49],
|
|
276
|
+
Calcutta: ['Asia/Kolkata', 50],
|
|
277
|
+
Chita: ['', 51],
|
|
278
|
+
Choibalsan: ['', 49],
|
|
279
|
+
Chongqing: ['Asia/Shanghai', 52],
|
|
280
|
+
Chungking: ['Asia/Shanghai', 52],
|
|
281
|
+
Colombo: ['', 53],
|
|
282
|
+
Dacca: ['Asia/Dhaka', 45],
|
|
283
|
+
Damascus: ['', 43],
|
|
284
|
+
Dhaka: ['', 45],
|
|
285
|
+
Dili: ['', 51],
|
|
286
|
+
Dubai: ['', 47],
|
|
287
|
+
Dushanbe: ['', 41],
|
|
288
|
+
Famagusta: ['', 54],
|
|
289
|
+
Gaza: ['', 55],
|
|
290
|
+
Harbin: ['Asia/Shanghai', 52],
|
|
291
|
+
Hebron: ['', 55],
|
|
292
|
+
Ho_Chi_Minh: ['', 38],
|
|
293
|
+
Hong_Kong: ['', 56],
|
|
294
|
+
Hovd: ['', 38],
|
|
295
|
+
Irkutsk: ['', 49],
|
|
296
|
+
Istanbul: ['Europe/Istanbul', 43],
|
|
297
|
+
Jakarta: ['', 57],
|
|
298
|
+
Jayapura: ['', 58],
|
|
299
|
+
Jerusalem: ['', 59],
|
|
300
|
+
Kabul: ['', 60],
|
|
301
|
+
Kamchatka: ['', 46],
|
|
302
|
+
Karachi: ['', 61],
|
|
303
|
+
Kashgar: ['Asia/Urumqi', 45],
|
|
304
|
+
Kathmandu: ['', 62],
|
|
305
|
+
Katmandu: ['Asia/Kathmandu', 62],
|
|
306
|
+
Khandyga: ['', 51],
|
|
307
|
+
Kolkata: ['', 50],
|
|
308
|
+
Krasnoyarsk: ['', 38],
|
|
309
|
+
Kuala_Lumpur: ['Asia/Singapore', 49],
|
|
310
|
+
Kuching: ['', 49],
|
|
311
|
+
Kuwait: ['Asia/Riyadh', 43],
|
|
312
|
+
Macao: ['Asia/Macau', 52],
|
|
313
|
+
Macau: ['', 52],
|
|
314
|
+
Magadan: ['', 37],
|
|
315
|
+
Makassar: ['', 63],
|
|
316
|
+
Manila: ['', 64],
|
|
317
|
+
Muscat: ['Asia/Dubai', 47],
|
|
318
|
+
Nicosia: ['', 65],
|
|
319
|
+
Novokuznetsk: ['', 38],
|
|
320
|
+
Novosibirsk: ['', 38],
|
|
321
|
+
Omsk: ['', 45],
|
|
322
|
+
Oral: ['', 41],
|
|
323
|
+
Phnom_Penh: ['Asia/Bangkok', 38],
|
|
324
|
+
Pontianak: ['', 57],
|
|
325
|
+
Pyongyang: ['', 66],
|
|
326
|
+
Qatar: ['', 43],
|
|
327
|
+
Qostanay: ['', 45],
|
|
328
|
+
Qyzylorda: ['', 41],
|
|
329
|
+
Rangoon: ['Asia/Yangon', 67],
|
|
330
|
+
Riyadh: ['', 43],
|
|
331
|
+
Saigon: ['Asia/Ho_Chi_Minh', 38],
|
|
332
|
+
Sakhalin: ['', 37],
|
|
333
|
+
Samarkand: ['', 41],
|
|
334
|
+
Seoul: ['', 66],
|
|
335
|
+
Shanghai: ['', 52],
|
|
336
|
+
Singapore: ['', 49],
|
|
337
|
+
Srednekolymsk: ['', 37],
|
|
338
|
+
Taipei: ['', 52],
|
|
339
|
+
Tashkent: ['', 41],
|
|
340
|
+
Tbilisi: ['', 47],
|
|
341
|
+
Tehran: ['', 68],
|
|
342
|
+
Tel_Aviv: ['Asia/Jerusalem', 59],
|
|
343
|
+
Thimbu: ['Asia/Thimphu', 45],
|
|
344
|
+
Thimphu: ['', 45],
|
|
345
|
+
Tokyo: ['', 69],
|
|
346
|
+
Tomsk: ['', 38],
|
|
347
|
+
Ujung_Pandang: ['Asia/Makassar', 63],
|
|
348
|
+
Ulaanbaatar: ['', 49],
|
|
349
|
+
Ulan_Bator: ['Asia/Ulaanbaatar', 49],
|
|
350
|
+
Urumqi: ['', 45],
|
|
351
|
+
'Ust-Nera': ['', 39],
|
|
352
|
+
Vientiane: ['Asia/Bangkok', 38],
|
|
353
|
+
Vladivostok: ['', 39],
|
|
354
|
+
Yakutsk: ['', 51],
|
|
355
|
+
Yangon: ['', 67],
|
|
356
|
+
Yekaterinburg: ['', 41],
|
|
357
|
+
Yerevan: ['', 47],
|
|
358
|
+
},
|
|
359
|
+
Atlantic: {
|
|
360
|
+
Azores: ['', 35],
|
|
361
|
+
Bermuda: ['', 25],
|
|
362
|
+
Canary: ['', 70],
|
|
363
|
+
Cape_Verde: ['', 71],
|
|
364
|
+
Faeroe: ['Atlantic/Faroe', 70],
|
|
365
|
+
Faroe: ['', 70],
|
|
366
|
+
Jan_Mayen: ['Europe/Berlin', 7],
|
|
367
|
+
Madeira: ['', 70],
|
|
368
|
+
Reykjavik: ['Africa/Abidjan', 0],
|
|
369
|
+
South_Georgia: ['', 32],
|
|
370
|
+
St_Helena: ['Africa/Abidjan', 0],
|
|
371
|
+
Stanley: ['', 12],
|
|
372
|
+
},
|
|
373
|
+
Australia: {
|
|
374
|
+
ACT: ['Australia/Sydney', 40],
|
|
375
|
+
Adelaide: ['', 72],
|
|
376
|
+
Brisbane: ['', 73],
|
|
377
|
+
Broken_Hill: ['', 72],
|
|
378
|
+
Canberra: ['Australia/Sydney', 40],
|
|
379
|
+
Currie: ['Australia/Hobart', 74],
|
|
380
|
+
Darwin: ['', 75],
|
|
381
|
+
Eucla: ['', 76],
|
|
382
|
+
Hobart: ['', 74],
|
|
383
|
+
LHI: ['Australia/Lord_Howe', 77],
|
|
384
|
+
Lindeman: ['', 73],
|
|
385
|
+
Lord_Howe: ['', 77],
|
|
386
|
+
Melbourne: ['', 40],
|
|
387
|
+
North: ['Australia/Darwin', 75],
|
|
388
|
+
NSW: ['Australia/Sydney', 40],
|
|
389
|
+
Perth: ['', 78],
|
|
390
|
+
Queensland: ['Australia/Brisbane', 73],
|
|
391
|
+
South: ['Australia/Adelaide', 72],
|
|
392
|
+
Sydney: ['', 40],
|
|
393
|
+
Tasmania: ['Australia/Hobart', 74],
|
|
394
|
+
Victoria: ['Australia/Melbourne', 40],
|
|
395
|
+
West: ['Australia/Perth', 78],
|
|
396
|
+
Yancowinna: ['Australia/Broken_Hill', 72],
|
|
397
|
+
},
|
|
398
|
+
Brazil: {
|
|
399
|
+
Acre: ['America/Rio_Branco', 18],
|
|
400
|
+
DeNoronha: ['America/Noronha', 32],
|
|
401
|
+
East: ['America/Sao_Paulo', 12],
|
|
402
|
+
West: ['America/Manaus', 17],
|
|
403
|
+
},
|
|
404
|
+
Canada: {
|
|
405
|
+
Atlantic: ['America/Halifax', 25],
|
|
406
|
+
Central: ['America/Winnipeg', 20],
|
|
407
|
+
Eastern: ['America/Toronto', 23],
|
|
408
|
+
Mountain: ['America/Edmonton', 19],
|
|
409
|
+
Newfoundland: ['America/St_Johns', 36],
|
|
410
|
+
Pacific: ['America/Vancouver', 24],
|
|
411
|
+
Saskatchewan: ['America/Regina', 16],
|
|
412
|
+
Yukon: ['America/Whitehorse', 22],
|
|
413
|
+
},
|
|
414
|
+
CET: ['', 7],
|
|
415
|
+
Chile: { Continental: ['America/Santiago', 34], EasterIsland: ['Pacific/Easter', 79] },
|
|
416
|
+
CST6CDT: ['', 20],
|
|
417
|
+
Cuba: ['America/Havana', 29],
|
|
418
|
+
EET: ['', 54],
|
|
419
|
+
Egypt: ['Africa/Cairo', 5],
|
|
420
|
+
Eire: ['Europe/Dublin', 80],
|
|
421
|
+
EST: ['', 14],
|
|
422
|
+
EST5EDT: ['', 23],
|
|
423
|
+
Etc: {
|
|
424
|
+
'GMT-0': ['Etc/GMT', 0],
|
|
425
|
+
'GMT-1': ['', 6],
|
|
426
|
+
'GMT-10': ['', 39],
|
|
427
|
+
'GMT-11': ['', 37],
|
|
428
|
+
'GMT-12': ['', 46],
|
|
429
|
+
'GMT-13': ['', 81],
|
|
430
|
+
'GMT-14': ['', 82],
|
|
431
|
+
'GMT-2': ['', 83],
|
|
432
|
+
'GMT-3': ['', 43],
|
|
433
|
+
'GMT-4': ['', 47],
|
|
434
|
+
'GMT-5': ['', 41],
|
|
435
|
+
'GMT-6': ['', 45],
|
|
436
|
+
'GMT-7': ['', 38],
|
|
437
|
+
'GMT-8': ['', 49],
|
|
438
|
+
'GMT-9': ['', 51],
|
|
439
|
+
GMT: ['', 0],
|
|
440
|
+
'GMT+0': ['Etc/GMT', 0],
|
|
441
|
+
'GMT+1': ['', 71],
|
|
442
|
+
'GMT+10': ['', 84],
|
|
443
|
+
'GMT+11': ['', 85],
|
|
444
|
+
'GMT+12': ['', 86],
|
|
445
|
+
'GMT+2': ['', 32],
|
|
446
|
+
'GMT+3': ['', 12],
|
|
447
|
+
'GMT+4': ['', 17],
|
|
448
|
+
'GMT+5': ['', 18],
|
|
449
|
+
'GMT+6': ['', 87],
|
|
450
|
+
'GMT+7': ['', 88],
|
|
451
|
+
'GMT+8': ['', 89],
|
|
452
|
+
'GMT+9': ['', 90],
|
|
453
|
+
GMT0: ['Etc/GMT', 0],
|
|
454
|
+
Greenwich: ['Etc/GMT', 0],
|
|
455
|
+
UCT: ['Etc/UTC', 91],
|
|
456
|
+
Universal: ['Etc/UTC', 91],
|
|
457
|
+
UTC: ['', 91],
|
|
458
|
+
Zulu: ['Etc/UTC', 91],
|
|
459
|
+
},
|
|
460
|
+
Europe: {
|
|
461
|
+
Amsterdam: ['Europe/Brussels', 7],
|
|
462
|
+
Andorra: ['', 7],
|
|
463
|
+
Astrakhan: ['', 47],
|
|
464
|
+
Athens: ['', 54],
|
|
465
|
+
Belfast: ['Europe/London', 92],
|
|
466
|
+
Belgrade: ['', 7],
|
|
467
|
+
Berlin: ['', 7],
|
|
468
|
+
Bratislava: ['Europe/Prague', 7],
|
|
469
|
+
Brussels: ['', 7],
|
|
470
|
+
Bucharest: ['', 54],
|
|
471
|
+
Budapest: ['', 7],
|
|
472
|
+
Busingen: ['Europe/Zurich', 7],
|
|
473
|
+
Chisinau: ['', 93],
|
|
474
|
+
Copenhagen: ['Europe/Berlin', 7],
|
|
475
|
+
Dublin: ['', 80],
|
|
476
|
+
Gibraltar: ['', 7],
|
|
477
|
+
Guernsey: ['Europe/London', 92],
|
|
478
|
+
Helsinki: ['', 54],
|
|
479
|
+
Isle_of_Man: ['Europe/London', 92],
|
|
480
|
+
Istanbul: ['', 43],
|
|
481
|
+
Jersey: ['Europe/London', 92],
|
|
482
|
+
Kaliningrad: ['', 5],
|
|
483
|
+
Kiev: ['Europe/Kyiv', 65],
|
|
484
|
+
Kirov: ['', 43],
|
|
485
|
+
Kyiv: ['', 65],
|
|
486
|
+
Lisbon: ['', 94],
|
|
487
|
+
Ljubljana: ['Europe/Belgrade', 7],
|
|
488
|
+
London: ['', 92],
|
|
489
|
+
Luxembourg: ['Europe/Brussels', 7],
|
|
490
|
+
Madrid: ['', 7],
|
|
491
|
+
Malta: ['', 7],
|
|
492
|
+
Mariehamn: ['Europe/Helsinki', 54],
|
|
493
|
+
Minsk: ['', 43],
|
|
494
|
+
Monaco: ['Europe/Paris', 7],
|
|
495
|
+
Moscow: ['', 95],
|
|
496
|
+
Nicosia: ['Asia/Nicosia', 65],
|
|
497
|
+
Oslo: ['Europe/Berlin', 7],
|
|
498
|
+
Paris: ['', 7],
|
|
499
|
+
Podgorica: ['Europe/Belgrade', 7],
|
|
500
|
+
Prague: ['', 7],
|
|
501
|
+
Riga: ['', 54],
|
|
502
|
+
Rome: ['', 7],
|
|
503
|
+
Samara: ['', 47],
|
|
504
|
+
San_Marino: ['Europe/Rome', 7],
|
|
505
|
+
Sarajevo: ['Europe/Belgrade', 7],
|
|
506
|
+
Saratov: ['', 47],
|
|
507
|
+
Simferopol: ['', 95],
|
|
508
|
+
Skopje: ['Europe/Belgrade', 7],
|
|
509
|
+
Sofia: ['', 54],
|
|
510
|
+
Stockholm: ['Europe/Berlin', 7],
|
|
511
|
+
Tallinn: ['', 54],
|
|
512
|
+
Tirane: ['', 7],
|
|
513
|
+
Tiraspol: ['Europe/Chisinau', 93],
|
|
514
|
+
Ulyanovsk: ['', 47],
|
|
515
|
+
Uzhgorod: ['Europe/Kyiv', 65],
|
|
516
|
+
Vaduz: ['Europe/Zurich', 7],
|
|
517
|
+
Vatican: ['Europe/Rome', 7],
|
|
518
|
+
Vienna: ['', 7],
|
|
519
|
+
Vilnius: ['', 54],
|
|
520
|
+
Volgograd: ['', 43],
|
|
521
|
+
Warsaw: ['', 7],
|
|
522
|
+
Zagreb: ['Europe/Belgrade', 7],
|
|
523
|
+
Zaporozhye: ['Europe/Kyiv', 65],
|
|
524
|
+
Zurich: ['', 7],
|
|
525
|
+
},
|
|
526
|
+
'GB-Eire': ['Europe/London', 92],
|
|
527
|
+
GB: ['Europe/London', 92],
|
|
528
|
+
'GMT-0': ['Etc/GMT', 0],
|
|
529
|
+
GMT: ['Etc/GMT', 0],
|
|
530
|
+
'GMT+0': ['Etc/GMT', 0],
|
|
531
|
+
GMT0: ['Etc/GMT', 0],
|
|
532
|
+
Greenwich: ['Etc/GMT', 0],
|
|
533
|
+
Hongkong: ['Asia/Hong_Kong', 56],
|
|
534
|
+
HST: ['', 96],
|
|
535
|
+
Iceland: ['Africa/Abidjan', 0],
|
|
536
|
+
Indian: {
|
|
537
|
+
Antananarivo: ['Africa/Nairobi', 1],
|
|
538
|
+
Chagos: ['', 45],
|
|
539
|
+
Christmas: ['Asia/Bangkok', 38],
|
|
540
|
+
Cocos: ['Asia/Yangon', 67],
|
|
541
|
+
Comoro: ['Africa/Nairobi', 1],
|
|
542
|
+
Kerguelen: ['Indian/Maldives', 41],
|
|
543
|
+
Mahe: ['Asia/Dubai', 47],
|
|
544
|
+
Maldives: ['', 41],
|
|
545
|
+
Mauritius: ['', 47],
|
|
546
|
+
Mayotte: ['Africa/Nairobi', 1],
|
|
547
|
+
Reunion: ['Asia/Dubai', 47],
|
|
548
|
+
},
|
|
549
|
+
Iran: ['Asia/Tehran', 68],
|
|
550
|
+
Israel: ['Asia/Jerusalem', 59],
|
|
551
|
+
Jamaica: ['America/Jamaica', 14],
|
|
552
|
+
Japan: ['Asia/Tokyo', 69],
|
|
553
|
+
Kwajalein: ['Pacific/Kwajalein', 46],
|
|
554
|
+
Libya: ['Africa/Tripoli', 5],
|
|
555
|
+
MET: ['', 97],
|
|
556
|
+
Mexico: {
|
|
557
|
+
BajaNorte: ['America/Tijuana', 24],
|
|
558
|
+
BajaSur: ['America/Mazatlan', 21],
|
|
559
|
+
General: ['America/Mexico_City', 30],
|
|
560
|
+
},
|
|
561
|
+
MST: ['', 22],
|
|
562
|
+
MST7MDT: ['', 19],
|
|
563
|
+
Navajo: ['America/Denver', 19],
|
|
564
|
+
'NZ-CHAT': ['Pacific/Chatham', 98],
|
|
565
|
+
NZ: ['Pacific/Auckland', 42],
|
|
566
|
+
Pacific: {
|
|
567
|
+
Apia: ['', 81],
|
|
568
|
+
Auckland: ['', 42],
|
|
569
|
+
Bougainville: ['', 37],
|
|
570
|
+
Chatham: ['', 98],
|
|
571
|
+
Chuuk: ['Pacific/Port_Moresby', 39],
|
|
572
|
+
Easter: ['', 79],
|
|
573
|
+
Efate: ['', 37],
|
|
574
|
+
Enderbury: ['Pacific/Kanton', 81],
|
|
575
|
+
Fakaofo: ['', 81],
|
|
576
|
+
Fiji: ['', 99],
|
|
577
|
+
Funafuti: ['Pacific/Tarawa', 46],
|
|
578
|
+
Galapagos: ['', 87],
|
|
579
|
+
Gambier: ['', 90],
|
|
580
|
+
Guadalcanal: ['', 37],
|
|
581
|
+
Guam: ['', 100],
|
|
582
|
+
Honolulu: ['', 96],
|
|
583
|
+
Johnston: ['Pacific/Honolulu', 96],
|
|
584
|
+
Kanton: ['', 81],
|
|
585
|
+
Kiritimati: ['', 82],
|
|
586
|
+
Kosrae: ['', 37],
|
|
587
|
+
Kwajalein: ['', 46],
|
|
588
|
+
Majuro: ['Pacific/Tarawa', 46],
|
|
589
|
+
Marquesas: ['', 101],
|
|
590
|
+
Midway: ['Pacific/Pago_Pago', 102],
|
|
591
|
+
Nauru: ['', 46],
|
|
592
|
+
Niue: ['', 85],
|
|
593
|
+
Norfolk: ['', 103],
|
|
594
|
+
Noumea: ['', 37],
|
|
595
|
+
Pago_Pago: ['', 102],
|
|
596
|
+
Palau: ['', 51],
|
|
597
|
+
Pitcairn: ['', 89],
|
|
598
|
+
Pohnpei: ['Pacific/Guadalcanal', 37],
|
|
599
|
+
Ponape: ['Pacific/Guadalcanal', 37],
|
|
600
|
+
Port_Moresby: ['', 39],
|
|
601
|
+
Rarotonga: ['', 84],
|
|
602
|
+
Saipan: ['Pacific/Guam', 100],
|
|
603
|
+
Samoa: ['Pacific/Pago_Pago', 102],
|
|
604
|
+
Tahiti: ['', 84],
|
|
605
|
+
Tarawa: ['', 46],
|
|
606
|
+
Tongatapu: ['', 81],
|
|
607
|
+
Truk: ['Pacific/Port_Moresby', 39],
|
|
608
|
+
Wake: ['Pacific/Tarawa', 46],
|
|
609
|
+
Wallis: ['Pacific/Tarawa', 46],
|
|
610
|
+
Yap: ['Pacific/Port_Moresby', 39],
|
|
611
|
+
},
|
|
612
|
+
Poland: ['Europe/Warsaw', 7],
|
|
613
|
+
Portugal: ['Europe/Lisbon', 94],
|
|
614
|
+
PRC: ['Asia/Shanghai', 52],
|
|
615
|
+
PST8PDT: ['', 24],
|
|
616
|
+
ROC: ['Asia/Taipei', 52],
|
|
617
|
+
ROK: ['Asia/Seoul', 66],
|
|
618
|
+
Singapore: ['Asia/Singapore', 49],
|
|
619
|
+
Turkey: ['Europe/Istanbul', 43],
|
|
620
|
+
UCT: ['Etc/UTC', 91],
|
|
621
|
+
Universal: ['Etc/UTC', 91],
|
|
622
|
+
US: {
|
|
623
|
+
Alaska: ['America/Anchorage', 10],
|
|
624
|
+
Aleutian: ['America/Adak', 9],
|
|
625
|
+
Arizona: ['America/Phoenix', 22],
|
|
626
|
+
Central: ['America/Chicago', 20],
|
|
627
|
+
'East-Indiana': ['America/Indiana/Indianapolis', 23],
|
|
628
|
+
Eastern: ['America/New_York', 23],
|
|
629
|
+
Hawaii: ['Pacific/Honolulu', 96],
|
|
630
|
+
'Indiana-Starke': ['America/Indiana/Knox', 20],
|
|
631
|
+
Michigan: ['America/Detroit', 23],
|
|
632
|
+
Mountain: ['America/Denver', 19],
|
|
633
|
+
Pacific: ['America/Los_Angeles', 24],
|
|
634
|
+
Samoa: ['Pacific/Pago_Pago', 102],
|
|
635
|
+
},
|
|
636
|
+
UTC: ['Etc/UTC', 91],
|
|
637
|
+
'W-SU': ['Europe/Moscow', 95],
|
|
638
|
+
WET: ['', 70],
|
|
639
|
+
Zulu: ['Etc/UTC', 91],
|
|
640
|
+
};
|
|
641
|
+
const tzlibZonesDetailsDB = [
|
|
642
|
+
'20221015T115821Z<n><bs><n><tz>GMT<n><of>+0000<n><ot>+0000<n><s>19700101T000000<n><es><n>',
|
|
643
|
+
'20221015T115821Z<n><bs><n><tz>EAT<n><of>+0300<n><ot>+0300<n><s>19700101T000000<n><es><n>',
|
|
644
|
+
'20221015T115821Z<n><bs><n><tz>CET<n><of>+0100<n><ot>+0100<n><s>19700101T000000<n><es><n>',
|
|
645
|
+
'20221015T115821Z<n><bs><n><tz>WAT<n><of>+0100<n><ot>+0100<n><s>19700101T000000<n><es><n>',
|
|
646
|
+
'20221015T115821Z<n><bs><n><tz>CAT<n><of>+0200<n><ot>+0200<n><s>19700101T000000<n><es><n>',
|
|
647
|
+
'20221015T115821Z<n><bs><n><tz>EET<n><of>+0200<n><ot>+0200<n><s>19700101T000000<n><es><n>',
|
|
648
|
+
'20221015T115821Z<n><bs><n><tz>+01<n><of>+0100<n><ot>+0100<n><s>19700101T000000<n><es><n>',
|
|
649
|
+
'20221015T115821Z<n><bd><n><tz>CEST<n><of>+0100<n><ot>+0200<n><s>19700329T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>CET<n><of>+0200<n><ot>+0100<n><s>19701025T030000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>',
|
|
650
|
+
'20221015T115821Z<n><bs><n><tz>SAST<n><of>+0200<n><ot>+0200<n><s>19700101T000000<n><es><n>',
|
|
651
|
+
'20221015T115821Z<n><bd><n><tz>HDT<n><of>-1000<n><ot>-0900<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>HST<n><of>-0900<n><ot>-1000<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>',
|
|
652
|
+
'20221015T115821Z<n><bd><n><tz>AKDT<n><of>-0900<n><ot>-0800<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>AKST<n><of>-0800<n><ot>-0900<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>',
|
|
653
|
+
'20221015T115821Z<n><bs><n><tz>AST<n><of>-0400<n><ot>-0400<n><s>19700101T000000<n><es><n>',
|
|
654
|
+
'20221015T115821Z<n><bs><n><tz>-03<n><of>-0300<n><ot>-0300<n><s>19700101T000000<n><es><n>',
|
|
655
|
+
'20221015T115821Z<n><bd><n><tz>-03<n><of>-0400<n><ot>-0300<n><s>19701004T000000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=1SU<n><ed><n><bs><n><tz>-04<n><of>-0300<n><ot>-0400<n><s>19700322T000000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=4SU<n><es><n>',
|
|
656
|
+
'20221015T115821Z<n><bs><n><tz>EST<n><of>-0500<n><ot>-0500<n><s>19700101T000000<n><es><n>',
|
|
657
|
+
'20221015T115821Z<n><bs><n><tz>CST<n><of>-0500<n><ot>-0600<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n><bd><n><tz>CDT<n><of>-0600<n><ot>-0500<n><s>19700405T020000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><ed><n>',
|
|
658
|
+
'20221015T115821Z<n><bs><n><tz>CST<n><of>-0600<n><ot>-0600<n><s>19700101T000000<n><es><n>',
|
|
659
|
+
'20221015T115821Z<n><bs><n><tz>-04<n><of>-0400<n><ot>-0400<n><s>19700101T000000<n><es><n>',
|
|
660
|
+
'20221015T115821Z<n><bs><n><tz>-05<n><of>-0500<n><ot>-0500<n><s>19700101T000000<n><es><n>',
|
|
661
|
+
'20221015T115821Z<n><bd><n><tz>MDT<n><of>-0700<n><ot>-0600<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>MST<n><of>-0600<n><ot>-0700<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>',
|
|
662
|
+
'20221015T115821Z<n><bd><n><tz>CDT<n><of>-0600<n><ot>-0500<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>CST<n><of>-0500<n><ot>-0600<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>',
|
|
663
|
+
'20221015T115821Z<n><bd><n><tz>MDT<n><of>-0700<n><ot>-0600<n><s>19700405T020000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><ed><n><bs><n><tz>MST<n><of>-0600<n><ot>-0700<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>',
|
|
664
|
+
'20221015T115821Z<n><bs><n><tz>MST<n><of>-0700<n><ot>-0700<n><s>19700101T000000<n><es><n>',
|
|
665
|
+
'20221015T115821Z<n><bd><n><tz>EDT<n><of>-0500<n><ot>-0400<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>EST<n><of>-0400<n><ot>-0500<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>',
|
|
666
|
+
'20221015T115821Z<n><bd><n><tz>PDT<n><of>-0800<n><ot>-0700<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>PST<n><of>-0700<n><ot>-0800<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>',
|
|
667
|
+
'20221015T115821Z<n><bd><n><tz>ADT<n><of>-0400<n><ot>-0300<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>AST<n><of>-0300<n><ot>-0400<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>',
|
|
668
|
+
'20221015T115821Z<n><bd><n><tz>-02<n><of>-0300<n><ot>-0200<n><s>19700328T220000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SA<n><ed><n><bs><n><tz>-03<n><of>-0200<n><ot>-0300<n><s>19701024T230000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SA<n><es><n>',
|
|
669
|
+
'20221015T115821Z<n><bs><n><tz>AST<n><of>-0300<n><ot>-0400<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n><bd><n><tz>ADT<n><of>-0400<n><ot>-0300<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n>',
|
|
670
|
+
'20221015T115821Z<n><bs><n><tz>EST<n><of>-0400<n><ot>-0500<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n><bd><n><tz>EDT<n><of>-0500<n><ot>-0400<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n>',
|
|
671
|
+
'20221015T115821Z<n><bs><n><tz>CST<n><of>-0400<n><ot>-0500<n><s>19701101T010000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n><bd><n><tz>CDT<n><of>-0500<n><ot>-0400<n><s>19700308T000000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n>',
|
|
672
|
+
'20221015T115821Z<n><bd><n><tz>CDT<n><of>-0600<n><ot>-0500<n><s>19700405T020000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><ed><n><bs><n><tz>CST<n><of>-0500<n><ot>-0600<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>',
|
|
673
|
+
'20221015T115821Z<n><bd><n><tz>-02<n><of>-0300<n><ot>-0200<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n><bs><n><tz>-03<n><of>-0200<n><ot>-0300<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n>',
|
|
674
|
+
'20221015T115821Z<n><bs><n><tz>-02<n><of>-0200<n><ot>-0200<n><s>19700101T000000<n><es><n>',
|
|
675
|
+
'20221015T115821Z<n><bs><n><tz>CST<n><of>-0500<n><ot>-0600<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n><bd><n><tz>CDT<n><of>-0600<n><ot>-0500<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n>',
|
|
676
|
+
'20221015T115821Z<n><bs><n><tz>-04<n><of>-0300<n><ot>-0400<n><s>19700405T000000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n><bd><n><tz>-03<n><of>-0400<n><ot>-0300<n><s>19700906T000000<n><r>FREQ=YEARLY;BYMONTH=9;BYDAY=1SU<n><ed><n>',
|
|
677
|
+
'20221015T115821Z<n><bd><n><tz>+00<n><of>-0100<n><ot>+0000<n><s>19700329T000000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>-01<n><of>+0000<n><ot>-0100<n><s>19701025T010000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>',
|
|
678
|
+
'20221015T115821Z<n><bs><n><tz>NST<n><of>-0230<n><ot>-0330<n><s>19701101T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=1SU<n><es><n><bd><n><tz>NDT<n><of>-0330<n><ot>-0230<n><s>19700308T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=2SU<n><ed><n>',
|
|
679
|
+
'20221015T115821Z<n><bs><n><tz>+11<n><of>+1100<n><ot>+1100<n><s>19700101T000000<n><es><n>',
|
|
680
|
+
'20221015T115821Z<n><bs><n><tz>+07<n><of>+0700<n><ot>+0700<n><s>19700101T000000<n><es><n>',
|
|
681
|
+
'20221015T115821Z<n><bs><n><tz>+10<n><of>+1000<n><ot>+1000<n><s>19700101T000000<n><es><n>',
|
|
682
|
+
'20221015T115821Z<n><bs><n><tz>AEST<n><of>+1100<n><ot>+1000<n><s>19700405T030000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n><bd><n><tz>AEDT<n><of>+1000<n><ot>+1100<n><s>19701004T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=1SU<n><ed><n>',
|
|
683
|
+
'20221015T115821Z<n><bs><n><tz>+05<n><of>+0500<n><ot>+0500<n><s>19700101T000000<n><es><n>',
|
|
684
|
+
'20221015T115821Z<n><bd><n><tz>NZDT<n><of>+1200<n><ot>+1300<n><s>19700927T020000<n><r>FREQ=YEARLY;BYMONTH=9;BYDAY=-1SU<n><ed><n><bs><n><tz>NZST<n><of>+1300<n><ot>+1200<n><s>19700405T030000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n>',
|
|
685
|
+
'20221015T115821Z<n><bs><n><tz>+03<n><of>+0300<n><ot>+0300<n><s>19700101T000000<n><es><n>',
|
|
686
|
+
'20221015T115821Z<n><bd><n><tz>+02<n><of>+0000<n><ot>+0200<n><s>19700329T010000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>+00<n><of>+0200<n><ot>+0000<n><s>19701025T030000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>',
|
|
687
|
+
'20221015T115821Z<n><bs><n><tz>+06<n><of>+0600<n><ot>+0600<n><s>19700101T000000<n><es><n>',
|
|
688
|
+
'20221015T115821Z<n><bs><n><tz>+12<n><of>+1200<n><ot>+1200<n><s>19700101T000000<n><es><n>',
|
|
689
|
+
'20221015T115821Z<n><bs><n><tz>+04<n><of>+0400<n><ot>+0400<n><s>19700101T000000<n><es><n>',
|
|
690
|
+
'20221015T115821Z<n><bd><n><tz>EEST<n><of>+0200<n><ot>+0300<n><s>19700329T000000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>EET<n><of>+0300<n><ot>+0200<n><s>19701025T000000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>',
|
|
691
|
+
'20221015T115821Z<n><bs><n><tz>+08<n><of>+0800<n><ot>+0800<n><s>19700101T000000<n><es><n>',
|
|
692
|
+
'20221015T115821Z<n><bs><n><tz>IST<n><of>+0530<n><ot>+0530<n><s>19700101T000000<n><es><n>',
|
|
693
|
+
'20221015T115821Z<n><bs><n><tz>+09<n><of>+0900<n><ot>+0900<n><s>19700101T000000<n><es><n>',
|
|
694
|
+
'20221015T115821Z<n><bs><n><tz>CST<n><of>+0800<n><ot>+0800<n><s>19700101T000000<n><es><n>',
|
|
695
|
+
'20221015T115821Z<n><bs><n><tz>+0530<n><of>+0530<n><ot>+0530<n><s>19700101T000000<n><es><n>',
|
|
696
|
+
'20221015T115821Z<n><bd><n><tz>EEST<n><of>+0200<n><ot>+0300<n><s>19700329T030000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>EET<n><of>+0300<n><ot>+0200<n><s>19701025T040000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>',
|
|
697
|
+
'20221015T115821Z<n><bs><n><tz>EET<n><of>+0300<n><ot>+0200<n><s>19701024T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SA<n><es><n><bd><n><tz>EEST<n><of>+0200<n><ot>+0300<n><s>19700328T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SA<n><ed><n>',
|
|
698
|
+
'20221015T115821Z<n><bs><n><tz>HKT<n><of>+0800<n><ot>+0800<n><s>19700101T000000<n><es><n>',
|
|
699
|
+
'20221015T115821Z<n><bs><n><tz>WIB<n><of>+0700<n><ot>+0700<n><s>19700101T000000<n><es><n>',
|
|
700
|
+
'20221015T115821Z<n><bs><n><tz>WIT<n><of>+0900<n><ot>+0900<n><s>19700101T000000<n><es><n>',
|
|
701
|
+
'20221015T115821Z<n><bd><n><tz>IDT<n><of>+0200<n><ot>+0300<n><s>19700327T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1FR<n><ed><n><bs><n><tz>IST<n><of>+0300<n><ot>+0200<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>',
|
|
702
|
+
'20221015T115821Z<n><bs><n><tz>+0430<n><of>+0430<n><ot>+0430<n><s>19700101T000000<n><es><n>',
|
|
703
|
+
'20221015T115821Z<n><bs><n><tz>PKT<n><of>+0500<n><ot>+0500<n><s>19700101T000000<n><es><n>',
|
|
704
|
+
'20221015T115821Z<n><bs><n><tz>+0545<n><of>+0545<n><ot>+0545<n><s>19700101T000000<n><es><n>',
|
|
705
|
+
'20221015T115821Z<n><bs><n><tz>WITA<n><of>+0800<n><ot>+0800<n><s>19700101T000000<n><es><n>',
|
|
706
|
+
'20221015T115821Z<n><bs><n><tz>PST<n><of>+0800<n><ot>+0800<n><s>19700101T000000<n><es><n>',
|
|
707
|
+
'20221015T115821Z<n><bs><n><tz>EET<n><of>+0300<n><ot>+0200<n><s>19701025T040000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n><bd><n><tz>EEST<n><of>+0200<n><ot>+0300<n><s>19700329T030000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n>',
|
|
708
|
+
'20221015T115821Z<n><bs><n><tz>KST<n><of>+0900<n><ot>+0900<n><s>19700101T000000<n><es><n>',
|
|
709
|
+
'20221015T115821Z<n><bs><n><tz>+0630<n><of>+0630<n><ot>+0630<n><s>19700101T000000<n><es><n>',
|
|
710
|
+
'20221015T115821Z<n><bs><n><tz>+0330<n><of>+0330<n><ot>+0330<n><s>19700101T000000<n><es><n>',
|
|
711
|
+
'20221015T115821Z<n><bs><n><tz>JST<n><of>+0900<n><ot>+0900<n><s>19700101T000000<n><es><n>',
|
|
712
|
+
'20221015T115821Z<n><bd><n><tz>WEST<n><of>+0000<n><ot>+0100<n><s>19700329T010000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>WET<n><of>+0100<n><ot>+0000<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>',
|
|
713
|
+
'20221015T115821Z<n><bs><n><tz>-01<n><of>-0100<n><ot>-0100<n><s>19700101T000000<n><es><n>',
|
|
714
|
+
'20221015T115821Z<n><bs><n><tz>ACST<n><of>+1030<n><ot>+0930<n><s>19700405T030000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n><bd><n><tz>ACDT<n><of>+0930<n><ot>+1030<n><s>19701004T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=1SU<n><ed><n>',
|
|
715
|
+
'20221015T115821Z<n><bs><n><tz>AEST<n><of>+1000<n><ot>+1000<n><s>19700101T000000<n><es><n>',
|
|
716
|
+
'20221015T115821Z<n><bd><n><tz>AEDT<n><of>+1000<n><ot>+1100<n><s>19701004T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=1SU<n><ed><n><bs><n><tz>AEST<n><of>+1100<n><ot>+1000<n><s>19700405T030000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n>',
|
|
717
|
+
'20221015T115821Z<n><bs><n><tz>ACST<n><of>+0930<n><ot>+0930<n><s>19700101T000000<n><es><n>',
|
|
718
|
+
'20221015T115821Z<n><bs><n><tz>+0845<n><of>+0845<n><ot>+0845<n><s>19700101T000000<n><es><n>',
|
|
719
|
+
'20221015T115821Z<n><bs><n><tz>+1030<n><of>+1100<n><ot>+1030<n><s>19700405T020000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n><bd><n><tz>+11<n><of>+1030<n><ot>+1100<n><s>19701004T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=1SU<n><ed><n>',
|
|
720
|
+
'20221015T115821Z<n><bs><n><tz>AWST<n><of>+0800<n><ot>+0800<n><s>19700101T000000<n><es><n>',
|
|
721
|
+
'20221015T115821Z<n><bs><n><tz>-06<n><of>-0500<n><ot>-0600<n><s>19700404T220000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SA<n><es><n><bd><n><tz>-05<n><of>-0600<n><ot>-0500<n><s>19700905T220000<n><r>FREQ=YEARLY;BYMONTH=9;BYDAY=1SA<n><ed><n>',
|
|
722
|
+
'20221015T115821Z<n><bs><n><tz>IST<n><of>+0000<n><ot>+0100<n><s>19700329T010000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><es><n><bd><n><tz>GMT<n><of>+0100<n><ot>+0000<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><ed><n>',
|
|
723
|
+
'20221015T115821Z<n><bs><n><tz>+13<n><of>+1300<n><ot>+1300<n><s>19700101T000000<n><es><n>',
|
|
724
|
+
'20221015T115821Z<n><bs><n><tz>+14<n><of>+1400<n><ot>+1400<n><s>19700101T000000<n><es><n>',
|
|
725
|
+
'20221015T115821Z<n><bs><n><tz>+02<n><of>+0200<n><ot>+0200<n><s>19700101T000000<n><es><n>',
|
|
726
|
+
'20221015T115821Z<n><bs><n><tz>-10<n><of>-1000<n><ot>-1000<n><s>19700101T000000<n><es><n>',
|
|
727
|
+
'20221015T115821Z<n><bs><n><tz>-11<n><of>-1100<n><ot>-1100<n><s>19700101T000000<n><es><n>',
|
|
728
|
+
'20221015T115821Z<n><bs><n><tz>-12<n><of>-1200<n><ot>-1200<n><s>19700101T000000<n><es><n>',
|
|
729
|
+
'20221015T115821Z<n><bs><n><tz>-06<n><of>-0600<n><ot>-0600<n><s>19700101T000000<n><es><n>',
|
|
730
|
+
'20221015T115821Z<n><bs><n><tz>-07<n><of>-0700<n><ot>-0700<n><s>19700101T000000<n><es><n>',
|
|
731
|
+
'20221015T115821Z<n><bs><n><tz>-08<n><of>-0800<n><ot>-0800<n><s>19700101T000000<n><es><n>',
|
|
732
|
+
'20221015T115821Z<n><bs><n><tz>-09<n><of>-0900<n><ot>-0900<n><s>19700101T000000<n><es><n>',
|
|
733
|
+
'20221015T115821Z<n><bs><n><tz>UTC<n><of>+0000<n><ot>+0000<n><s>19700101T000000<n><es><n>',
|
|
734
|
+
'20221015T115821Z<n><bd><n><tz>BST<n><of>+0000<n><ot>+0100<n><s>19700329T010000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>GMT<n><of>+0100<n><ot>+0000<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>',
|
|
735
|
+
'20221015T115821Z<n><bd><n><tz>EEST<n><of>+0200<n><ot>+0300<n><s>19700329T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>EET<n><of>+0300<n><ot>+0200<n><s>19701025T030000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>',
|
|
736
|
+
'20221015T115821Z<n><bs><n><tz>WET<n><of>+0100<n><ot>+0000<n><s>19701025T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n><bd><n><tz>WEST<n><of>+0000<n><ot>+0100<n><s>19700329T010000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n>',
|
|
737
|
+
'20221015T115821Z<n><bs><n><tz>MSK<n><of>+0300<n><ot>+0300<n><s>19700101T000000<n><es><n>',
|
|
738
|
+
'20221015T115821Z<n><bs><n><tz>HST<n><of>-1000<n><ot>-1000<n><s>19700101T000000<n><es><n>',
|
|
739
|
+
'20221015T115821Z<n><bd><n><tz>MEST<n><of>+0100<n><ot>+0200<n><s>19700329T020000<n><r>FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<n><ed><n><bs><n><tz>MET<n><of>+0200<n><ot>+0100<n><s>19701025T030000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<n><es><n>',
|
|
740
|
+
'20221015T115821Z<n><bd><n><tz>+1345<n><of>+1245<n><ot>+1345<n><s>19700927T024500<n><r>FREQ=YEARLY;BYMONTH=9;BYDAY=-1SU<n><ed><n><bs><n><tz>+1245<n><of>+1345<n><ot>+1245<n><s>19700405T034500<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n>',
|
|
741
|
+
'20221015T115821Z<n><bd><n><tz>+13<n><of>+1200<n><ot>+1300<n><s>19701108T020000<n><r>FREQ=YEARLY;BYMONTH=11;BYDAY=2SU<n><ed><n><bs><n><tz>+12<n><of>+1300<n><ot>+1200<n><s>19700118T030000<n><r>FREQ=YEARLY;BYMONTH=1;BYDAY=-2SU<n><es><n>',
|
|
742
|
+
'20221015T115821Z<n><bs><n><tz>ChST<n><of>+1000<n><ot>+1000<n><s>19700101T000000<n><es><n>',
|
|
743
|
+
'20221015T115821Z<n><bs><n><tz>-0930<n><of>-0930<n><ot>-0930<n><s>19700101T000000<n><es><n>',
|
|
744
|
+
'20221015T115821Z<n><bs><n><tz>SST<n><of>-1100<n><ot>-1100<n><s>19700101T000000<n><es><n>',
|
|
745
|
+
'20221015T115821Z<n><bd><n><tz>+12<n><of>+1100<n><ot>+1200<n><s>19701004T020000<n><r>FREQ=YEARLY;BYMONTH=10;BYDAY=1SU<n><ed><n><bs><n><tz>+11<n><of>+1200<n><ot>+1100<n><s>19700405T030000<n><r>FREQ=YEARLY;BYMONTH=4;BYDAY=1SU<n><es><n>',
|
|
746
|
+
];
|
|
747
|
+
function tzlib_get_content(tzName) {
|
|
748
|
+
const nameParts = tzName.split('/');
|
|
749
|
+
if (
|
|
750
|
+
(nameParts.length === 3 &&
|
|
751
|
+
(!tzlibZonesDB[`${nameParts[0]}`] ||
|
|
752
|
+
!tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`] ||
|
|
753
|
+
!tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`][`${nameParts[2]}`])) ||
|
|
754
|
+
(nameParts.length === 2 &&
|
|
755
|
+
(!tzlibZonesDB[`${nameParts[0]}`] || !tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`])) ||
|
|
756
|
+
(nameParts.length === 1 && !tzlibZonesDB[`${nameParts[0]}`])
|
|
757
|
+
) {
|
|
758
|
+
console.error('Given timezone not valid.');
|
|
759
|
+
return '';
|
|
760
|
+
}
|
|
761
|
+
if (nameParts.length === 3) {
|
|
762
|
+
return [
|
|
763
|
+
tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`][`${nameParts[2]}`][0],
|
|
764
|
+
tzlib_enrich_data(
|
|
765
|
+
tzlibZonesDetailsDB[tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`][`${nameParts[2]}`][1]]
|
|
766
|
+
),
|
|
767
|
+
];
|
|
768
|
+
}
|
|
769
|
+
if (nameParts.length === 2) {
|
|
770
|
+
return [
|
|
771
|
+
tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`][0],
|
|
772
|
+
tzlib_enrich_data(tzlibZonesDetailsDB[tzlibZonesDB[`${nameParts[0]}`][`${nameParts[1]}`][1]]),
|
|
773
|
+
];
|
|
774
|
+
}
|
|
775
|
+
return [
|
|
776
|
+
tzlibZonesDB[`${nameParts[0]}`][0],
|
|
777
|
+
tzlib_enrich_data(tzlibZonesDetailsDB[tzlibZonesDB[`${nameParts[0]}`][1]]),
|
|
778
|
+
];
|
|
779
|
+
}
|
|
780
|
+
function tzlib_enrich_data(string) {
|
|
781
|
+
const shortenerMap = {
|
|
782
|
+
'<br>': '<n>',
|
|
783
|
+
'TZNAME:': '<tz>',
|
|
784
|
+
'TZOFFSETFROM:': '<of>',
|
|
785
|
+
'TZOFFSETTO:': '<ot>',
|
|
786
|
+
'DTSTART:': '<s>',
|
|
787
|
+
'RRULE:': '<r>',
|
|
788
|
+
'BEGIN:DAYLIGHT': '<bd>',
|
|
789
|
+
'END:DAYLIGHT': '<ed>',
|
|
790
|
+
'BEGIN:STANDARD': '<bs>',
|
|
791
|
+
'END:STANDARD': '<es>',
|
|
792
|
+
};
|
|
793
|
+
for (const [key, value] of Object.entries(shortenerMap)) {
|
|
794
|
+
string = string.replaceAll(value, key);
|
|
795
|
+
}
|
|
796
|
+
return string;
|
|
797
|
+
}
|
|
798
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
799
|
+
function tzlib_get_ical_block(tzName, jsonType = false) {
|
|
800
|
+
const tzBlock = tzlib_get_content(tzName);
|
|
801
|
+
if (tzBlock[1] == null || tzBlock[1] == '') {
|
|
802
|
+
return '';
|
|
803
|
+
}
|
|
804
|
+
const location = (function () {
|
|
805
|
+
if (tzBlock[0] == '') {
|
|
806
|
+
return tzName;
|
|
807
|
+
} else {
|
|
808
|
+
return tzBlock[0];
|
|
809
|
+
}
|
|
810
|
+
})();
|
|
811
|
+
const tzidLine = 'TZID=' + location;
|
|
812
|
+
const output = [
|
|
813
|
+
'BEGIN:VTIMEZONE\r\nTZID:' +
|
|
814
|
+
location +
|
|
815
|
+
'\r\nX-LIC-LOCATION:' +
|
|
816
|
+
location +
|
|
817
|
+
'\r\nLAST-MODIFIED:' +
|
|
818
|
+
tzBlock[1].replace(/[^\w_\-:,;=+/<br>]/g, '').replace(/<br>/g, '\r\n') +
|
|
819
|
+
'END:VTIMEZONE',
|
|
820
|
+
tzidLine,
|
|
821
|
+
];
|
|
822
|
+
if (jsonType) {
|
|
823
|
+
return JSON.stringify(output);
|
|
824
|
+
}
|
|
825
|
+
return output;
|
|
826
|
+
}
|
|
827
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
828
|
+
function tzlib_get_offset(tzName, isoDate, isoTime) {
|
|
829
|
+
const tzBlock = tzlib_get_content(tzName);
|
|
830
|
+
if (tzBlock[1] == null || tzBlock[1] == '') {
|
|
831
|
+
return '';
|
|
832
|
+
}
|
|
833
|
+
if (!isoDate.match(/^\d{4}-\d{2}-\d{2}$/)) {
|
|
834
|
+
console.error('offset calculation failed: date misspelled [-> YYYY-MM-DD]');
|
|
835
|
+
return '';
|
|
836
|
+
}
|
|
837
|
+
if (!isoTime.match(/^\d{2}:\d{2}$/)) {
|
|
838
|
+
console.error('offset calculation failed: time misspelled [-> hh:mm]');
|
|
839
|
+
return '';
|
|
840
|
+
}
|
|
841
|
+
if (!tzBlock[1].match(/BEGIN:DAYLIGHT/i)) {
|
|
842
|
+
return tzBlock[1].match(/TZOFFSETTO:([+|-]\d{4})/i)[1];
|
|
843
|
+
}
|
|
844
|
+
const dateString = isoDate + 'T' + isoTime + ':00';
|
|
845
|
+
const date = new Date(dateString);
|
|
846
|
+
const dateYear = date.getFullYear();
|
|
847
|
+
const dateMonth = date.getMonth() + 1;
|
|
848
|
+
const dateDay = date.getDate();
|
|
849
|
+
const dateHour = date.getHours();
|
|
850
|
+
const timezoneData = tzBlock[1].replace(/[^\w_\-:,;=+/<br>]/g, '').split('<br>');
|
|
851
|
+
const tzBreakpoints = { 1: {}, 2: {} };
|
|
852
|
+
let breakpointCount = 0;
|
|
853
|
+
for (let i = 0; i < timezoneData.length; i++) {
|
|
854
|
+
if (timezoneData[`${i}`].startsWith('TZOFFSETTO')) {
|
|
855
|
+
breakpointCount++;
|
|
856
|
+
tzBreakpoints[`${breakpointCount}`].offset = timezoneData[`${i}`].split(':')[1];
|
|
857
|
+
}
|
|
858
|
+
if (timezoneData[`${i}`].startsWith('DTSTART')) {
|
|
859
|
+
tzBreakpoints[`${breakpointCount}`].hour = parseInt(timezoneData[`${i}`].substr(17, 2));
|
|
860
|
+
}
|
|
861
|
+
if (timezoneData[`${i}`].startsWith('RRULE')) {
|
|
862
|
+
let rruleParts = timezoneData[`${i}`].split(';');
|
|
863
|
+
let rruleMonth = parseInt(rruleParts[1].split('=')[1]);
|
|
864
|
+
tzBreakpoints[`${breakpointCount}`].month = parseInt(rruleMonth);
|
|
865
|
+
tzBreakpoints[`${breakpointCount}`].day = rruleParts[2].split('=')[1];
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
if (tzBreakpoints[1].month > tzBreakpoints[2].month) {
|
|
869
|
+
[tzBreakpoints[1], tzBreakpoints[2]] = [tzBreakpoints[2], tzBreakpoints[1]];
|
|
870
|
+
}
|
|
871
|
+
if (dateMonth != tzBreakpoints[1].month && dateMonth != tzBreakpoints[2].month) {
|
|
872
|
+
if (dateMonth < tzBreakpoints[1].month || dateMonth > tzBreakpoints[2].month) {
|
|
873
|
+
return tzBreakpoints[2].offset;
|
|
874
|
+
} else {
|
|
875
|
+
return tzBreakpoints[1].offset;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
const theCase = (function () {
|
|
879
|
+
return Object.keys(tzBreakpoints).find((key) => tzBreakpoints[`${key}`].month == dateMonth);
|
|
880
|
+
})();
|
|
881
|
+
const helperArrayWeekdays = ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'];
|
|
882
|
+
const numberDays = new Date(dateYear, dateMonth, 0).getDate();
|
|
883
|
+
let weekdayCount = new Date(dateYear, dateMonth - 1, 1).getDay();
|
|
884
|
+
const weekdays = { SU: {}, MO: {}, TU: {}, WE: {}, TH: {}, FR: {}, SA: {} };
|
|
885
|
+
for (let d = 1; d <= numberDays; d++) {
|
|
886
|
+
const occurence = Object.keys(weekdays[helperArrayWeekdays[`${weekdayCount}`]]).length + 1;
|
|
887
|
+
weekdays[helperArrayWeekdays[`${weekdayCount}`]][`${occurence}`] = d;
|
|
888
|
+
weekdayCount++;
|
|
889
|
+
if (weekdayCount == 7) {
|
|
890
|
+
weekdayCount = 0;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
const actualDay = (function () {
|
|
894
|
+
if (tzBreakpoints[`${theCase}`].day[0] == '-') {
|
|
895
|
+
const breakpointWeekday = tzBreakpoints[`${theCase}`].day.substr(2, 2);
|
|
896
|
+
const dayIndex =
|
|
897
|
+
Object.keys(weekdays[`${breakpointWeekday}`]).length +
|
|
898
|
+
1 -
|
|
899
|
+
parseInt(tzBreakpoints[`${theCase}`].day[1]);
|
|
900
|
+
return weekdays[`${breakpointWeekday}`][`${dayIndex}`];
|
|
901
|
+
} else {
|
|
902
|
+
const breakpointWeekday = tzBreakpoints[`${theCase}`].day.substr(1, 2);
|
|
903
|
+
return weekdays[`${breakpointWeekday}`][tzBreakpoints[`${theCase}`].day[0]];
|
|
904
|
+
}
|
|
905
|
+
})();
|
|
906
|
+
if (dateDay > actualDay || (dateDay == actualDay && dateHour >= tzBreakpoints[`${theCase}`].hour)) {
|
|
907
|
+
return tzBreakpoints[`${theCase}`].offset;
|
|
908
|
+
}
|
|
909
|
+
const fallbackCase = (function () {
|
|
910
|
+
if (theCase == 1) {
|
|
911
|
+
return 2;
|
|
912
|
+
} else {
|
|
913
|
+
return 1;
|
|
914
|
+
}
|
|
915
|
+
})();
|
|
916
|
+
return tzBreakpoints[`${fallbackCase}`].offset;
|
|
917
|
+
}
|
|
918
|
+
let tzlibZoneNames = [];
|
|
919
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
920
|
+
function tzlib_get_timezones(jsonType = false) {
|
|
921
|
+
if (tzlibZoneNames.length == 0) {
|
|
922
|
+
tzlibZoneNames = (function () {
|
|
923
|
+
let namesArr = [];
|
|
924
|
+
for (const [key, value] of Object.entries(tzlibZonesDB)) {
|
|
925
|
+
if (typeof value === 'object' && !Array.isArray(value)) {
|
|
926
|
+
for (const [key2, value2] of Object.entries(value)) {
|
|
927
|
+
if (typeof value2 === 'object' && !Array.isArray(value2)) {
|
|
928
|
+
for (const [key3] of Object.entries(value2)) {
|
|
929
|
+
namesArr.push(key + '/' + key2 + '/' + key3);
|
|
930
|
+
}
|
|
931
|
+
} else {
|
|
932
|
+
namesArr.push(key + '/' + key2);
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
} else {
|
|
936
|
+
namesArr.push(key);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
return namesArr;
|
|
940
|
+
})();
|
|
941
|
+
}
|
|
942
|
+
if (jsonType) {
|
|
943
|
+
return JSON.stringify(tzlibZoneNames);
|
|
944
|
+
}
|
|
945
|
+
return tzlibZoneNames;
|
|
946
|
+
}
|
|
947
|
+
module.exports = { tzlib_get_ical_block, tzlib_get_offset, tzlib_get_timezones };
|