@forcecalendar/core 2.1.0 → 2.1.2
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/core/calendar/Calendar.js +7 -9
- package/core/calendar/DateUtils.js +10 -9
- package/core/conflicts/ConflictDetector.js +24 -24
- package/core/events/Event.js +14 -20
- package/core/events/EventStore.js +70 -19
- package/core/events/RRuleParser.js +423 -394
- package/core/events/RecurrenceEngine.js +33 -21
- package/core/events/RecurrenceEngineV2.js +536 -562
- package/core/ics/ICSHandler.js +348 -348
- package/core/ics/ICSParser.js +433 -435
- package/core/index.js +1 -1
- package/core/integration/EnhancedCalendar.js +363 -398
- package/core/performance/AdaptiveMemoryManager.js +310 -308
- package/core/performance/LRUCache.js +3 -4
- package/core/performance/PerformanceOptimizer.js +4 -6
- package/core/search/EventSearch.js +409 -417
- package/core/search/SearchWorkerManager.js +338 -338
- package/core/state/StateManager.js +4 -2
- package/core/timezone/TimezoneDatabase.js +574 -271
- package/core/timezone/TimezoneManager.js +422 -402
- package/core/types.js +1 -1
- package/package.json +1 -1
|
@@ -4,291 +4,594 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export class TimezoneDatabase {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
constructor() {
|
|
8
|
+
// Comprehensive IANA timezone offset data (Standard Time)
|
|
9
|
+
// Offsets in minutes from UTC
|
|
10
|
+
this.timezones = {
|
|
11
|
+
// UTC
|
|
12
|
+
UTC: { offset: 0, dst: null },
|
|
13
|
+
GMT: { offset: 0, dst: null },
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'America/Denver': { offset: -420, dst: { start: { month: 3, week: 2, day: 0 }, end: { month: 11, week: 1, day: 0 }, offset: 60 }},
|
|
33
|
-
'America/Detroit': { offset: -300, dst: { start: { month: 3, week: 2, day: 0 }, end: { month: 11, week: 1, day: 0 }, offset: 60 }},
|
|
34
|
-
'America/Halifax': { offset: -240, dst: { start: { month: 3, week: 2, day: 0 }, end: { month: 11, week: 1, day: 0 }, offset: 60 }},
|
|
35
|
-
'America/Los_Angeles': { offset: -480, dst: { start: { month: 3, week: 2, day: 0 }, end: { month: 11, week: 1, day: 0 }, offset: 60 }},
|
|
36
|
-
'America/Mexico_City': { offset: -360, dst: { start: { month: 4, week: 1, day: 0 }, end: { month: 10, week: -1, day: 0 }, offset: 60 }},
|
|
37
|
-
'America/New_York': { offset: -300, dst: { start: { month: 3, week: 2, day: 0 }, end: { month: 11, week: 1, day: 0 }, offset: 60 }},
|
|
38
|
-
'America/Phoenix': { offset: -420, dst: null },
|
|
39
|
-
'America/Regina': { offset: -360, dst: null },
|
|
40
|
-
'America/Santiago': { offset: -180, dst: { start: { month: 9, week: 1, day: 0 }, end: { month: 4, week: 1, day: 0 }, offset: 60 }},
|
|
41
|
-
'America/Sao_Paulo': { offset: -180, dst: { start: { month: 10, week: 3, day: 0 }, end: { month: 2, week: 3, day: 0 }, offset: 60 }},
|
|
42
|
-
'America/St_Johns': { offset: -210, dst: { start: { month: 3, week: 2, day: 0 }, end: { month: 11, week: 1, day: 0 }, offset: 60 }},
|
|
43
|
-
'America/Toronto': { offset: -300, dst: { start: { month: 3, week: 2, day: 0 }, end: { month: 11, week: 1, day: 0 }, offset: 60 }},
|
|
44
|
-
'America/Vancouver': { offset: -480, dst: { start: { month: 3, week: 2, day: 0 }, end: { month: 11, week: 1, day: 0 }, offset: 60 }},
|
|
15
|
+
// Africa
|
|
16
|
+
'Africa/Abidjan': { offset: 0, dst: null },
|
|
17
|
+
'Africa/Accra': { offset: 0, dst: null },
|
|
18
|
+
'Africa/Addis_Ababa': { offset: 180, dst: null },
|
|
19
|
+
'Africa/Algiers': { offset: 60, dst: null },
|
|
20
|
+
'Africa/Cairo': { offset: 120, dst: null },
|
|
21
|
+
'Africa/Casablanca': {
|
|
22
|
+
offset: 60,
|
|
23
|
+
dst: {
|
|
24
|
+
start: { month: 3, week: -1, day: 0 },
|
|
25
|
+
end: { month: 10, week: -1, day: 0 },
|
|
26
|
+
offset: 60
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
'Africa/Johannesburg': { offset: 120, dst: null },
|
|
30
|
+
'Africa/Lagos': { offset: 60, dst: null },
|
|
31
|
+
'Africa/Nairobi': { offset: 180, dst: null },
|
|
45
32
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
33
|
+
// Americas
|
|
34
|
+
'America/Anchorage': {
|
|
35
|
+
offset: -540,
|
|
36
|
+
dst: {
|
|
37
|
+
start: { month: 3, week: 2, day: 0 },
|
|
38
|
+
end: { month: 11, week: 1, day: 0 },
|
|
39
|
+
offset: 60
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
'America/Argentina/Buenos_Aires': { offset: -180, dst: null },
|
|
43
|
+
'America/Bogota': { offset: -300, dst: null },
|
|
44
|
+
'America/Caracas': { offset: -240, dst: null },
|
|
45
|
+
'America/Chicago': {
|
|
46
|
+
offset: -360,
|
|
47
|
+
dst: {
|
|
48
|
+
start: { month: 3, week: 2, day: 0 },
|
|
49
|
+
end: { month: 11, week: 1, day: 0 },
|
|
50
|
+
offset: 60
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
'America/Denver': {
|
|
54
|
+
offset: -420,
|
|
55
|
+
dst: {
|
|
56
|
+
start: { month: 3, week: 2, day: 0 },
|
|
57
|
+
end: { month: 11, week: 1, day: 0 },
|
|
58
|
+
offset: 60
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
'America/Detroit': {
|
|
62
|
+
offset: -300,
|
|
63
|
+
dst: {
|
|
64
|
+
start: { month: 3, week: 2, day: 0 },
|
|
65
|
+
end: { month: 11, week: 1, day: 0 },
|
|
66
|
+
offset: 60
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
'America/Halifax': {
|
|
70
|
+
offset: -240,
|
|
71
|
+
dst: {
|
|
72
|
+
start: { month: 3, week: 2, day: 0 },
|
|
73
|
+
end: { month: 11, week: 1, day: 0 },
|
|
74
|
+
offset: 60
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
'America/Los_Angeles': {
|
|
78
|
+
offset: -480,
|
|
79
|
+
dst: {
|
|
80
|
+
start: { month: 3, week: 2, day: 0 },
|
|
81
|
+
end: { month: 11, week: 1, day: 0 },
|
|
82
|
+
offset: 60
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
'America/Mexico_City': {
|
|
86
|
+
offset: -360,
|
|
87
|
+
dst: {
|
|
88
|
+
start: { month: 4, week: 1, day: 0 },
|
|
89
|
+
end: { month: 10, week: -1, day: 0 },
|
|
90
|
+
offset: 60
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
'America/New_York': {
|
|
94
|
+
offset: -300,
|
|
95
|
+
dst: {
|
|
96
|
+
start: { month: 3, week: 2, day: 0 },
|
|
97
|
+
end: { month: 11, week: 1, day: 0 },
|
|
98
|
+
offset: 60
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
'America/Phoenix': { offset: -420, dst: null },
|
|
102
|
+
'America/Regina': { offset: -360, dst: null },
|
|
103
|
+
'America/Santiago': {
|
|
104
|
+
offset: -180,
|
|
105
|
+
dst: {
|
|
106
|
+
start: { month: 9, week: 1, day: 0 },
|
|
107
|
+
end: { month: 4, week: 1, day: 0 },
|
|
108
|
+
offset: 60
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
'America/Sao_Paulo': {
|
|
112
|
+
offset: -180,
|
|
113
|
+
dst: {
|
|
114
|
+
start: { month: 10, week: 3, day: 0 },
|
|
115
|
+
end: { month: 2, week: 3, day: 0 },
|
|
116
|
+
offset: 60
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
'America/St_Johns': {
|
|
120
|
+
offset: -210,
|
|
121
|
+
dst: {
|
|
122
|
+
start: { month: 3, week: 2, day: 0 },
|
|
123
|
+
end: { month: 11, week: 1, day: 0 },
|
|
124
|
+
offset: 60
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
'America/Toronto': {
|
|
128
|
+
offset: -300,
|
|
129
|
+
dst: {
|
|
130
|
+
start: { month: 3, week: 2, day: 0 },
|
|
131
|
+
end: { month: 11, week: 1, day: 0 },
|
|
132
|
+
offset: 60
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
'America/Vancouver': {
|
|
136
|
+
offset: -480,
|
|
137
|
+
dst: {
|
|
138
|
+
start: { month: 3, week: 2, day: 0 },
|
|
139
|
+
end: { month: 11, week: 1, day: 0 },
|
|
140
|
+
offset: 60
|
|
141
|
+
}
|
|
142
|
+
},
|
|
63
143
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
144
|
+
// Asia
|
|
145
|
+
'Asia/Baghdad': { offset: 180, dst: null },
|
|
146
|
+
'Asia/Bangkok': { offset: 420, dst: null },
|
|
147
|
+
'Asia/Dubai': { offset: 240, dst: null },
|
|
148
|
+
'Asia/Hong_Kong': { offset: 480, dst: null },
|
|
149
|
+
'Asia/Jakarta': { offset: 420, dst: null },
|
|
150
|
+
'Asia/Jerusalem': {
|
|
151
|
+
offset: 120,
|
|
152
|
+
dst: {
|
|
153
|
+
start: { month: 3, week: -1, day: 5 },
|
|
154
|
+
end: { month: 10, week: -1, day: 0 },
|
|
155
|
+
offset: 60
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
'Asia/Karachi': { offset: 300, dst: null },
|
|
159
|
+
'Asia/Kolkata': { offset: 330, dst: null },
|
|
160
|
+
'Asia/Kuala_Lumpur': { offset: 480, dst: null },
|
|
161
|
+
'Asia/Manila': { offset: 480, dst: null },
|
|
162
|
+
'Asia/Seoul': { offset: 540, dst: null },
|
|
163
|
+
'Asia/Shanghai': { offset: 480, dst: null },
|
|
164
|
+
'Asia/Singapore': { offset: 480, dst: null },
|
|
165
|
+
'Asia/Taipei': { offset: 480, dst: null },
|
|
166
|
+
'Asia/Tehran': {
|
|
167
|
+
offset: 210,
|
|
168
|
+
dst: {
|
|
169
|
+
start: { month: 3, week: 4, day: 0 },
|
|
170
|
+
end: { month: 9, week: 4, day: 0 },
|
|
171
|
+
offset: 60
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
'Asia/Tokyo': { offset: 540, dst: null },
|
|
68
175
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
176
|
+
// Atlantic
|
|
177
|
+
'Atlantic/Azores': {
|
|
178
|
+
offset: -60,
|
|
179
|
+
dst: {
|
|
180
|
+
start: { month: 3, week: -1, day: 0 },
|
|
181
|
+
end: { month: 10, week: -1, day: 0 },
|
|
182
|
+
offset: 60
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
'Atlantic/Bermuda': {
|
|
186
|
+
offset: -240,
|
|
187
|
+
dst: {
|
|
188
|
+
start: { month: 3, week: 2, day: 0 },
|
|
189
|
+
end: { month: 11, week: 1, day: 0 },
|
|
190
|
+
offset: 60
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
'Atlantic/Reykjavik': { offset: 0, dst: null },
|
|
77
194
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
195
|
+
// Australia & Pacific
|
|
196
|
+
'Australia/Adelaide': {
|
|
197
|
+
offset: 570,
|
|
198
|
+
dst: {
|
|
199
|
+
start: { month: 10, week: 1, day: 0 },
|
|
200
|
+
end: { month: 4, week: 1, day: 0 },
|
|
201
|
+
offset: 60
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
'Australia/Brisbane': { offset: 600, dst: null },
|
|
205
|
+
'Australia/Darwin': { offset: 570, dst: null },
|
|
206
|
+
'Australia/Hobart': {
|
|
207
|
+
offset: 600,
|
|
208
|
+
dst: {
|
|
209
|
+
start: { month: 10, week: 1, day: 0 },
|
|
210
|
+
end: { month: 4, week: 1, day: 0 },
|
|
211
|
+
offset: 60
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
'Australia/Melbourne': {
|
|
215
|
+
offset: 600,
|
|
216
|
+
dst: {
|
|
217
|
+
start: { month: 10, week: 1, day: 0 },
|
|
218
|
+
end: { month: 4, week: 1, day: 0 },
|
|
219
|
+
offset: 60
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
'Australia/Perth': { offset: 480, dst: null },
|
|
223
|
+
'Australia/Sydney': {
|
|
224
|
+
offset: 600,
|
|
225
|
+
dst: {
|
|
226
|
+
start: { month: 10, week: 1, day: 0 },
|
|
227
|
+
end: { month: 4, week: 1, day: 0 },
|
|
228
|
+
offset: 60
|
|
229
|
+
}
|
|
230
|
+
},
|
|
101
231
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
232
|
+
// Europe
|
|
233
|
+
'Europe/Amsterdam': {
|
|
234
|
+
offset: 60,
|
|
235
|
+
dst: {
|
|
236
|
+
start: { month: 3, week: -1, day: 0 },
|
|
237
|
+
end: { month: 10, week: -1, day: 0 },
|
|
238
|
+
offset: 60
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
'Europe/Athens': {
|
|
242
|
+
offset: 120,
|
|
243
|
+
dst: {
|
|
244
|
+
start: { month: 3, week: -1, day: 0 },
|
|
245
|
+
end: { month: 10, week: -1, day: 0 },
|
|
246
|
+
offset: 60
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
'Europe/Berlin': {
|
|
250
|
+
offset: 60,
|
|
251
|
+
dst: {
|
|
252
|
+
start: { month: 3, week: -1, day: 0 },
|
|
253
|
+
end: { month: 10, week: -1, day: 0 },
|
|
254
|
+
offset: 60
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
'Europe/Brussels': {
|
|
258
|
+
offset: 60,
|
|
259
|
+
dst: {
|
|
260
|
+
start: { month: 3, week: -1, day: 0 },
|
|
261
|
+
end: { month: 10, week: -1, day: 0 },
|
|
262
|
+
offset: 60
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
'Europe/Budapest': {
|
|
266
|
+
offset: 60,
|
|
267
|
+
dst: {
|
|
268
|
+
start: { month: 3, week: -1, day: 0 },
|
|
269
|
+
end: { month: 10, week: -1, day: 0 },
|
|
270
|
+
offset: 60
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
'Europe/Copenhagen': {
|
|
274
|
+
offset: 60,
|
|
275
|
+
dst: {
|
|
276
|
+
start: { month: 3, week: -1, day: 0 },
|
|
277
|
+
end: { month: 10, week: -1, day: 0 },
|
|
278
|
+
offset: 60
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
'Europe/Dublin': {
|
|
282
|
+
offset: 0,
|
|
283
|
+
dst: {
|
|
284
|
+
start: { month: 3, week: -1, day: 0 },
|
|
285
|
+
end: { month: 10, week: -1, day: 0 },
|
|
286
|
+
offset: 60
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
'Europe/Helsinki': {
|
|
290
|
+
offset: 120,
|
|
291
|
+
dst: {
|
|
292
|
+
start: { month: 3, week: -1, day: 0 },
|
|
293
|
+
end: { month: 10, week: -1, day: 0 },
|
|
294
|
+
offset: 60
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
'Europe/Istanbul': { offset: 180, dst: null },
|
|
298
|
+
'Europe/Kiev': {
|
|
299
|
+
offset: 120,
|
|
300
|
+
dst: {
|
|
301
|
+
start: { month: 3, week: -1, day: 0 },
|
|
302
|
+
end: { month: 10, week: -1, day: 0 },
|
|
303
|
+
offset: 60
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
'Europe/Lisbon': {
|
|
307
|
+
offset: 0,
|
|
308
|
+
dst: {
|
|
309
|
+
start: { month: 3, week: -1, day: 0 },
|
|
310
|
+
end: { month: 10, week: -1, day: 0 },
|
|
311
|
+
offset: 60
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
'Europe/London': {
|
|
315
|
+
offset: 0,
|
|
316
|
+
dst: {
|
|
317
|
+
start: { month: 3, week: -1, day: 0 },
|
|
318
|
+
end: { month: 10, week: -1, day: 0 },
|
|
319
|
+
offset: 60
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
'Europe/Madrid': {
|
|
323
|
+
offset: 60,
|
|
324
|
+
dst: {
|
|
325
|
+
start: { month: 3, week: -1, day: 0 },
|
|
326
|
+
end: { month: 10, week: -1, day: 0 },
|
|
327
|
+
offset: 60
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
'Europe/Moscow': { offset: 180, dst: null },
|
|
331
|
+
'Europe/Oslo': {
|
|
332
|
+
offset: 60,
|
|
333
|
+
dst: {
|
|
334
|
+
start: { month: 3, week: -1, day: 0 },
|
|
335
|
+
end: { month: 10, week: -1, day: 0 },
|
|
336
|
+
offset: 60
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
'Europe/Paris': {
|
|
340
|
+
offset: 60,
|
|
341
|
+
dst: {
|
|
342
|
+
start: { month: 3, week: -1, day: 0 },
|
|
343
|
+
end: { month: 10, week: -1, day: 0 },
|
|
344
|
+
offset: 60
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
'Europe/Prague': {
|
|
348
|
+
offset: 60,
|
|
349
|
+
dst: {
|
|
350
|
+
start: { month: 3, week: -1, day: 0 },
|
|
351
|
+
end: { month: 10, week: -1, day: 0 },
|
|
352
|
+
offset: 60
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
'Europe/Rome': {
|
|
356
|
+
offset: 60,
|
|
357
|
+
dst: {
|
|
358
|
+
start: { month: 3, week: -1, day: 0 },
|
|
359
|
+
end: { month: 10, week: -1, day: 0 },
|
|
360
|
+
offset: 60
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
'Europe/Stockholm': {
|
|
364
|
+
offset: 60,
|
|
365
|
+
dst: {
|
|
366
|
+
start: { month: 3, week: -1, day: 0 },
|
|
367
|
+
end: { month: 10, week: -1, day: 0 },
|
|
368
|
+
offset: 60
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
'Europe/Vienna': {
|
|
372
|
+
offset: 60,
|
|
373
|
+
dst: {
|
|
374
|
+
start: { month: 3, week: -1, day: 0 },
|
|
375
|
+
end: { month: 10, week: -1, day: 0 },
|
|
376
|
+
offset: 60
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
'Europe/Warsaw': {
|
|
380
|
+
offset: 60,
|
|
381
|
+
dst: {
|
|
382
|
+
start: { month: 3, week: -1, day: 0 },
|
|
383
|
+
end: { month: 10, week: -1, day: 0 },
|
|
384
|
+
offset: 60
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
'Europe/Zurich': {
|
|
388
|
+
offset: 60,
|
|
389
|
+
dst: {
|
|
390
|
+
start: { month: 3, week: -1, day: 0 },
|
|
391
|
+
end: { month: 10, week: -1, day: 0 },
|
|
392
|
+
offset: 60
|
|
393
|
+
}
|
|
394
|
+
},
|
|
105
395
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
'Pacific/Guam': { offset: 600, dst: null },
|
|
110
|
-
'Pacific/Honolulu': { offset: -600, dst: null },
|
|
111
|
-
'Pacific/Midway': { offset: -660, dst: null },
|
|
112
|
-
'Pacific/Noumea': { offset: 660, dst: null },
|
|
113
|
-
'Pacific/Pago_Pago': { offset: -660, dst: null },
|
|
114
|
-
'Pacific/Port_Moresby': { offset: 600, dst: null },
|
|
115
|
-
'Pacific/Tahiti': { offset: -600, dst: null }
|
|
116
|
-
};
|
|
396
|
+
// Indian
|
|
397
|
+
'Indian/Maldives': { offset: 300, dst: null },
|
|
398
|
+
'Indian/Mauritius': { offset: 240, dst: null },
|
|
117
399
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
'EEST': 'Europe/Athens',
|
|
144
|
-
'MSK': 'Europe/Moscow',
|
|
145
|
-
'JST': 'Asia/Tokyo',
|
|
146
|
-
'KST': 'Asia/Seoul',
|
|
147
|
-
'CST_CN': 'Asia/Shanghai',
|
|
148
|
-
'HKT': 'Asia/Hong_Kong',
|
|
149
|
-
'SGT': 'Asia/Singapore',
|
|
150
|
-
'AEST': 'Australia/Sydney',
|
|
151
|
-
'AEDT': 'Australia/Sydney',
|
|
152
|
-
'ACST': 'Australia/Adelaide',
|
|
153
|
-
'ACDT': 'Australia/Adelaide',
|
|
154
|
-
'AWST': 'Australia/Perth',
|
|
155
|
-
'NZST': 'Pacific/Auckland',
|
|
156
|
-
'NZDT': 'Pacific/Auckland',
|
|
400
|
+
// Pacific
|
|
401
|
+
'Pacific/Auckland': {
|
|
402
|
+
offset: 720,
|
|
403
|
+
dst: {
|
|
404
|
+
start: { month: 9, week: -1, day: 0 },
|
|
405
|
+
end: { month: 4, week: 1, day: 0 },
|
|
406
|
+
offset: 60
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
'Pacific/Fiji': {
|
|
410
|
+
offset: 720,
|
|
411
|
+
dst: {
|
|
412
|
+
start: { month: 11, week: 1, day: 0 },
|
|
413
|
+
end: { month: 1, week: 3, day: 0 },
|
|
414
|
+
offset: 60
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
'Pacific/Guam': { offset: 600, dst: null },
|
|
418
|
+
'Pacific/Honolulu': { offset: -600, dst: null },
|
|
419
|
+
'Pacific/Midway': { offset: -660, dst: null },
|
|
420
|
+
'Pacific/Noumea': { offset: 660, dst: null },
|
|
421
|
+
'Pacific/Pago_Pago': { offset: -660, dst: null },
|
|
422
|
+
'Pacific/Port_Moresby': { offset: 600, dst: null },
|
|
423
|
+
'Pacific/Tahiti': { offset: -600, dst: null }
|
|
424
|
+
};
|
|
157
425
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
426
|
+
// Timezone aliases and abbreviations
|
|
427
|
+
this.aliases = {
|
|
428
|
+
// Common abbreviations to IANA
|
|
429
|
+
EST: 'America/New_York',
|
|
430
|
+
EDT: 'America/New_York',
|
|
431
|
+
CST: 'America/Chicago',
|
|
432
|
+
CDT: 'America/Chicago',
|
|
433
|
+
MST: 'America/Denver',
|
|
434
|
+
MDT: 'America/Denver',
|
|
435
|
+
PST: 'America/Los_Angeles',
|
|
436
|
+
PDT: 'America/Los_Angeles',
|
|
437
|
+
AKST: 'America/Anchorage',
|
|
438
|
+
AKDT: 'America/Anchorage',
|
|
439
|
+
HST: 'Pacific/Honolulu',
|
|
440
|
+
AST: 'America/Halifax',
|
|
441
|
+
ADT: 'America/Halifax',
|
|
442
|
+
NST: 'America/St_Johns',
|
|
443
|
+
NDT: 'America/St_Johns',
|
|
444
|
+
BST: 'Europe/London',
|
|
445
|
+
IST: 'Asia/Kolkata',
|
|
446
|
+
WET: 'Europe/Lisbon',
|
|
447
|
+
WEST: 'Europe/Lisbon',
|
|
448
|
+
CET: 'Europe/Paris',
|
|
449
|
+
CEST: 'Europe/Paris',
|
|
450
|
+
EET: 'Europe/Athens',
|
|
451
|
+
EEST: 'Europe/Athens',
|
|
452
|
+
MSK: 'Europe/Moscow',
|
|
453
|
+
JST: 'Asia/Tokyo',
|
|
454
|
+
KST: 'Asia/Seoul',
|
|
455
|
+
CST_CN: 'Asia/Shanghai',
|
|
456
|
+
HKT: 'Asia/Hong_Kong',
|
|
457
|
+
SGT: 'Asia/Singapore',
|
|
458
|
+
AEST: 'Australia/Sydney',
|
|
459
|
+
AEDT: 'Australia/Sydney',
|
|
460
|
+
ACST: 'Australia/Adelaide',
|
|
461
|
+
ACDT: 'Australia/Adelaide',
|
|
462
|
+
AWST: 'Australia/Perth',
|
|
463
|
+
NZST: 'Pacific/Auckland',
|
|
464
|
+
NZDT: 'Pacific/Auckland',
|
|
193
465
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
466
|
+
// City/Country aliases
|
|
467
|
+
'US/Eastern': 'America/New_York',
|
|
468
|
+
'US/Central': 'America/Chicago',
|
|
469
|
+
'US/Mountain': 'America/Denver',
|
|
470
|
+
'US/Pacific': 'America/Los_Angeles',
|
|
471
|
+
'US/Alaska': 'America/Anchorage',
|
|
472
|
+
'US/Hawaii': 'Pacific/Honolulu',
|
|
473
|
+
'Canada/Eastern': 'America/Toronto',
|
|
474
|
+
'Canada/Central': 'America/Regina',
|
|
475
|
+
'Canada/Mountain': 'America/Denver',
|
|
476
|
+
'Canada/Pacific': 'America/Vancouver',
|
|
477
|
+
'Canada/Atlantic': 'America/Halifax',
|
|
478
|
+
'Canada/Newfoundland': 'America/St_Johns',
|
|
479
|
+
'Mexico/General': 'America/Mexico_City',
|
|
480
|
+
'Brazil/East': 'America/Sao_Paulo',
|
|
481
|
+
'Chile/Continental': 'America/Santiago',
|
|
482
|
+
GB: 'Europe/London',
|
|
483
|
+
'GB-Eire': 'Europe/London',
|
|
484
|
+
Eire: 'Europe/Dublin',
|
|
485
|
+
Israel: 'Asia/Jerusalem',
|
|
486
|
+
Japan: 'Asia/Tokyo',
|
|
487
|
+
Singapore: 'Asia/Singapore',
|
|
488
|
+
Hongkong: 'Asia/Hong_Kong',
|
|
489
|
+
ROK: 'Asia/Seoul',
|
|
490
|
+
PRC: 'Asia/Shanghai',
|
|
491
|
+
'Australia/NSW': 'Australia/Sydney',
|
|
492
|
+
'Australia/Victoria': 'Australia/Melbourne',
|
|
493
|
+
'Australia/Queensland': 'Australia/Brisbane',
|
|
494
|
+
'Australia/South': 'Australia/Adelaide',
|
|
495
|
+
'Australia/Tasmania': 'Australia/Hobart',
|
|
496
|
+
'Australia/West': 'Australia/Perth',
|
|
497
|
+
'Australia/North': 'Australia/Darwin',
|
|
498
|
+
NZ: 'Pacific/Auckland'
|
|
499
|
+
};
|
|
500
|
+
}
|
|
204
501
|
|
|
205
|
-
|
|
502
|
+
/**
|
|
503
|
+
* Get timezone data by identifier
|
|
504
|
+
* @param {string} timezone - Timezone identifier or alias
|
|
505
|
+
* @returns {Object|null} Timezone data or null if not found
|
|
506
|
+
*/
|
|
507
|
+
getTimezone(timezone) {
|
|
508
|
+
// Check for alias first
|
|
509
|
+
if (this.aliases[timezone]) {
|
|
510
|
+
timezone = this.aliases[timezone];
|
|
206
511
|
}
|
|
207
512
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
* @returns {string[]} Array of timezone identifiers
|
|
211
|
-
*/
|
|
212
|
-
getAllTimezones() {
|
|
213
|
-
return Object.keys(this.timezones);
|
|
214
|
-
}
|
|
513
|
+
return this.timezones[timezone] || null;
|
|
514
|
+
}
|
|
215
515
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
516
|
+
/**
|
|
517
|
+
* Get all available timezone identifiers
|
|
518
|
+
* @returns {string[]} Array of timezone identifiers
|
|
519
|
+
*/
|
|
520
|
+
getAllTimezones() {
|
|
521
|
+
return Object.keys(this.timezones);
|
|
522
|
+
}
|
|
224
523
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
524
|
+
/**
|
|
525
|
+
* Check if a timezone identifier is valid
|
|
526
|
+
* @param {string} timezone - Timezone identifier
|
|
527
|
+
* @returns {boolean} True if valid
|
|
528
|
+
*/
|
|
529
|
+
isValidTimezone(timezone) {
|
|
530
|
+
return this.aliases[timezone] !== undefined || this.timezones[timezone] !== undefined;
|
|
531
|
+
}
|
|
233
532
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
.map(([id, _]) => id);
|
|
243
|
-
}
|
|
533
|
+
/**
|
|
534
|
+
* Resolve timezone alias to canonical identifier
|
|
535
|
+
* @param {string} timezone - Timezone identifier or alias
|
|
536
|
+
* @returns {string} Canonical timezone identifier
|
|
537
|
+
*/
|
|
538
|
+
resolveAlias(timezone) {
|
|
539
|
+
return this.aliases[timezone] || timezone;
|
|
540
|
+
}
|
|
244
541
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
542
|
+
/**
|
|
543
|
+
* Get timezones by offset
|
|
544
|
+
* @param {number} offsetMinutes - Offset in minutes from UTC
|
|
545
|
+
* @returns {string[]} Array of timezone identifiers
|
|
546
|
+
*/
|
|
547
|
+
getTimezonesByOffset(offsetMinutes) {
|
|
548
|
+
return Object.entries(this.timezones)
|
|
549
|
+
.filter(([_, data]) => data.offset === offsetMinutes)
|
|
550
|
+
.map(([id, _]) => id);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Get common timezones for quick selection
|
|
555
|
+
* @returns {Object} Grouped timezones by region
|
|
556
|
+
*/
|
|
557
|
+
getCommonTimezones() {
|
|
558
|
+
return {
|
|
559
|
+
Americas: [
|
|
560
|
+
'America/New_York',
|
|
561
|
+
'America/Chicago',
|
|
562
|
+
'America/Denver',
|
|
563
|
+
'America/Los_Angeles',
|
|
564
|
+
'America/Toronto',
|
|
565
|
+
'America/Mexico_City',
|
|
566
|
+
'America/Sao_Paulo'
|
|
567
|
+
],
|
|
568
|
+
Europe: [
|
|
569
|
+
'Europe/London',
|
|
570
|
+
'Europe/Paris',
|
|
571
|
+
'Europe/Berlin',
|
|
572
|
+
'Europe/Moscow',
|
|
573
|
+
'Europe/Rome',
|
|
574
|
+
'Europe/Madrid',
|
|
575
|
+
'Europe/Amsterdam'
|
|
576
|
+
],
|
|
577
|
+
Asia: [
|
|
578
|
+
'Asia/Tokyo',
|
|
579
|
+
'Asia/Shanghai',
|
|
580
|
+
'Asia/Hong_Kong',
|
|
581
|
+
'Asia/Singapore',
|
|
582
|
+
'Asia/Kolkata',
|
|
583
|
+
'Asia/Dubai',
|
|
584
|
+
'Asia/Seoul'
|
|
585
|
+
],
|
|
586
|
+
'Australia/Pacific': [
|
|
587
|
+
'Australia/Sydney',
|
|
588
|
+
'Australia/Melbourne',
|
|
589
|
+
'Australia/Brisbane',
|
|
590
|
+
'Australia/Perth',
|
|
591
|
+
'Pacific/Auckland',
|
|
592
|
+
'Pacific/Honolulu'
|
|
593
|
+
],
|
|
594
|
+
Africa: ['Africa/Cairo', 'Africa/Lagos', 'Africa/Johannesburg', 'Africa/Nairobi']
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
}
|