chronos-ts 2.0.2 → 2.0.3

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.
@@ -1,679 +0,0 @@
1
- "use strict";
2
- /**
3
- * ChronosTimezone - Timezone handling and conversions
4
- * @module ChronosTimezone
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Timezones = exports.ChronosTimezone = exports.TIMEZONES = void 0;
8
- // ============================================================================
9
- // Timezone Data
10
- // ============================================================================
11
- /**
12
- * Common timezone identifiers
13
- */
14
- exports.TIMEZONES = {
15
- // UTC
16
- UTC: 'UTC',
17
- GMT: 'GMT',
18
- // Americas
19
- 'America/New_York': 'America/New_York',
20
- 'America/Chicago': 'America/Chicago',
21
- 'America/Denver': 'America/Denver',
22
- 'America/Los_Angeles': 'America/Los_Angeles',
23
- 'America/Phoenix': 'America/Phoenix',
24
- 'America/Anchorage': 'America/Anchorage',
25
- 'America/Toronto': 'America/Toronto',
26
- 'America/Vancouver': 'America/Vancouver',
27
- 'America/Mexico_City': 'America/Mexico_City',
28
- 'America/Sao_Paulo': 'America/Sao_Paulo',
29
- 'America/Buenos_Aires': 'America/Buenos_Aires',
30
- 'America/Lima': 'America/Lima',
31
- 'America/Bogota': 'America/Bogota',
32
- // Europe
33
- 'Europe/London': 'Europe/London',
34
- 'Europe/Paris': 'Europe/Paris',
35
- 'Europe/Berlin': 'Europe/Berlin',
36
- 'Europe/Madrid': 'Europe/Madrid',
37
- 'Europe/Rome': 'Europe/Rome',
38
- 'Europe/Amsterdam': 'Europe/Amsterdam',
39
- 'Europe/Brussels': 'Europe/Brussels',
40
- 'Europe/Vienna': 'Europe/Vienna',
41
- 'Europe/Warsaw': 'Europe/Warsaw',
42
- 'Europe/Prague': 'Europe/Prague',
43
- 'Europe/Moscow': 'Europe/Moscow',
44
- 'Europe/Istanbul': 'Europe/Istanbul',
45
- 'Europe/Athens': 'Europe/Athens',
46
- 'Europe/Helsinki': 'Europe/Helsinki',
47
- 'Europe/Stockholm': 'Europe/Stockholm',
48
- 'Europe/Oslo': 'Europe/Oslo',
49
- 'Europe/Copenhagen': 'Europe/Copenhagen',
50
- 'Europe/Dublin': 'Europe/Dublin',
51
- 'Europe/Zurich': 'Europe/Zurich',
52
- // Asia
53
- 'Asia/Tokyo': 'Asia/Tokyo',
54
- 'Asia/Shanghai': 'Asia/Shanghai',
55
- 'Asia/Hong_Kong': 'Asia/Hong_Kong',
56
- 'Asia/Singapore': 'Asia/Singapore',
57
- 'Asia/Seoul': 'Asia/Seoul',
58
- 'Asia/Taipei': 'Asia/Taipei',
59
- 'Asia/Bangkok': 'Asia/Bangkok',
60
- 'Asia/Jakarta': 'Asia/Jakarta',
61
- 'Asia/Manila': 'Asia/Manila',
62
- 'Asia/Kuala_Lumpur': 'Asia/Kuala_Lumpur',
63
- 'Asia/Ho_Chi_Minh': 'Asia/Ho_Chi_Minh',
64
- 'Asia/Dubai': 'Asia/Dubai',
65
- 'Asia/Kolkata': 'Asia/Kolkata',
66
- 'Asia/Mumbai': 'Asia/Mumbai',
67
- 'Asia/Karachi': 'Asia/Karachi',
68
- 'Asia/Dhaka': 'Asia/Dhaka',
69
- 'Asia/Tehran': 'Asia/Tehran',
70
- 'Asia/Riyadh': 'Asia/Riyadh',
71
- 'Asia/Jerusalem': 'Asia/Jerusalem',
72
- // Australia/Pacific
73
- 'Australia/Sydney': 'Australia/Sydney',
74
- 'Australia/Melbourne': 'Australia/Melbourne',
75
- 'Australia/Brisbane': 'Australia/Brisbane',
76
- 'Australia/Perth': 'Australia/Perth',
77
- 'Australia/Adelaide': 'Australia/Adelaide',
78
- 'Pacific/Auckland': 'Pacific/Auckland',
79
- 'Pacific/Fiji': 'Pacific/Fiji',
80
- 'Pacific/Honolulu': 'Pacific/Honolulu',
81
- // Africa
82
- 'Africa/Cairo': 'Africa/Cairo',
83
- 'Africa/Johannesburg': 'Africa/Johannesburg',
84
- 'Africa/Lagos': 'Africa/Lagos',
85
- 'Africa/Nairobi': 'Africa/Nairobi',
86
- 'Africa/Casablanca': 'Africa/Casablanca',
87
- };
88
- // ============================================================================
89
- // ChronosTimezone Class
90
- // ============================================================================
91
- /**
92
- * ChronosTimezone - Handles timezone operations and conversions
93
- *
94
- * This class provides comprehensive timezone handling including:
95
- * - Timezone information retrieval
96
- * - Offset calculations
97
- * - DST detection
98
- * - Timezone conversions
99
- *
100
- * @example
101
- * ```typescript
102
- * // Get timezone info
103
- * const tz = ChronosTimezone.create('America/New_York');
104
- * console.log(tz.offset); // -5 or -4 depending on DST
105
- *
106
- * // Check DST
107
- * console.log(tz.isDST(new Date())); // true/false
108
- *
109
- * // Convert between timezones
110
- * const utcDate = new Date();
111
- * const localDate = ChronosTimezone.convert(utcDate, 'UTC', 'America/New_York');
112
- * ```
113
- */
114
- class ChronosTimezone {
115
- // ============================================================================
116
- // Constructor
117
- // ============================================================================
118
- /**
119
- * Create a new ChronosTimezone
120
- */
121
- constructor(identifier = 'UTC') {
122
- this._originalOffset = null;
123
- this._extraMinutes = 0; // For non-whole-hour offsets like +05:30
124
- this._cachedOffset = null;
125
- this._cachedDate = null;
126
- const normalized = this._normalizeIdentifier(identifier);
127
- this._identifier = normalized.identifier;
128
- this._originalOffset = normalized.originalOffset;
129
- this._extraMinutes = normalized.extraMinutes;
130
- }
131
- /**
132
- * Normalize timezone identifier
133
- */
134
- _normalizeIdentifier(identifier) {
135
- // Handle UTC aliases
136
- if (identifier.toUpperCase() === 'Z' ||
137
- identifier.toUpperCase() === 'GMT') {
138
- return { identifier: 'UTC', originalOffset: null, extraMinutes: 0 };
139
- }
140
- // Handle offset strings like +05:30, -08:00
141
- if (/^[+-]\d{2}:\d{2}$/.test(identifier)) {
142
- // Store original offset and convert to Etc/GMT for internal use
143
- const offsetHours = this._parseOffsetString(identifier);
144
- const sign = offsetHours >= 0 ? 1 : -1;
145
- const absHours = Math.abs(offsetHours);
146
- const wholeHours = Math.floor(absHours);
147
- // Calculate extra minutes for non-whole-hour offsets (e.g., +05:30 has 30 extra minutes)
148
- const extraMinutes = Math.round((absHours - wholeHours) * 60) * sign;
149
- const etcGmt = `Etc/GMT${offsetHours >= 0 ? '-' : '+'}${wholeHours}`;
150
- return { identifier: etcGmt, originalOffset: identifier, extraMinutes };
151
- }
152
- return { identifier, originalOffset: null, extraMinutes: 0 };
153
- }
154
- /**
155
- * Parse offset string to hours
156
- */
157
- _parseOffsetString(offset) {
158
- const match = offset.match(/^([+-])(\d{2}):(\d{2})$/);
159
- if (!match)
160
- return 0;
161
- const sign = match[1] === '+' ? 1 : -1;
162
- const hours = parseInt(match[2], 10);
163
- const minutes = parseInt(match[3], 10);
164
- return sign * (hours + minutes / 60);
165
- }
166
- // ============================================================================
167
- // Static Factory Methods
168
- // ============================================================================
169
- /**
170
- * Create a timezone instance
171
- */
172
- static create(identifier = 'UTC') {
173
- return new ChronosTimezone(identifier);
174
- }
175
- /**
176
- * Create UTC timezone
177
- */
178
- static utc() {
179
- return new ChronosTimezone('UTC');
180
- }
181
- /**
182
- * Create timezone from local system timezone
183
- */
184
- static local() {
185
- const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
186
- return new ChronosTimezone(tz);
187
- }
188
- /**
189
- * Create timezone from offset in hours
190
- */
191
- static fromOffset(offsetHours) {
192
- const sign = offsetHours >= 0 ? '+' : '-';
193
- const absOffset = Math.abs(offsetHours);
194
- const hours = Math.floor(absOffset);
195
- const minutes = Math.round((absOffset - hours) * 60);
196
- const offsetString = `${sign}${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;
197
- return new ChronosTimezone(offsetString);
198
- }
199
- /**
200
- * Get the local system timezone identifier
201
- */
202
- static localIdentifier() {
203
- return Intl.DateTimeFormat().resolvedOptions().timeZone;
204
- }
205
- // ============================================================================
206
- // Getters
207
- // ============================================================================
208
- /**
209
- * Get timezone identifier
210
- * Returns the original offset string if created from an offset, otherwise returns the IANA identifier
211
- */
212
- get identifier() {
213
- var _a;
214
- return (_a = this._originalOffset) !== null && _a !== void 0 ? _a : this._identifier;
215
- }
216
- /**
217
- * Get the internal IANA timezone identifier (used for Intl operations)
218
- */
219
- get ianaIdentifier() {
220
- return this._identifier;
221
- }
222
- /**
223
- * Get timezone name (alias for identifier)
224
- */
225
- get name() {
226
- var _a;
227
- return (_a = this._originalOffset) !== null && _a !== void 0 ? _a : this._identifier;
228
- }
229
- /**
230
- * Get timezone abbreviation for a given date
231
- */
232
- getAbbreviation(date = new Date()) {
233
- var _a;
234
- try {
235
- const formatter = new Intl.DateTimeFormat('en-US', {
236
- timeZone: this._identifier,
237
- timeZoneName: 'short',
238
- });
239
- const parts = formatter.formatToParts(date);
240
- const tzPart = parts.find((p) => p.type === 'timeZoneName');
241
- return (_a = tzPart === null || tzPart === void 0 ? void 0 : tzPart.value) !== null && _a !== void 0 ? _a : this._identifier;
242
- }
243
- catch (_b) {
244
- return this._identifier;
245
- }
246
- }
247
- /**
248
- * Get full timezone name for a given date
249
- */
250
- getFullName(date = new Date()) {
251
- var _a;
252
- try {
253
- const formatter = new Intl.DateTimeFormat('en-US', {
254
- timeZone: this._identifier,
255
- timeZoneName: 'long',
256
- });
257
- const parts = formatter.formatToParts(date);
258
- const tzPart = parts.find((p) => p.type === 'timeZoneName');
259
- return (_a = tzPart === null || tzPart === void 0 ? void 0 : tzPart.value) !== null && _a !== void 0 ? _a : this._identifier;
260
- }
261
- catch (_b) {
262
- return this._identifier;
263
- }
264
- }
265
- // ============================================================================
266
- // Offset Calculations
267
- // ============================================================================
268
- /**
269
- * Get UTC offset in minutes for a given date
270
- */
271
- getOffsetMinutes(date = new Date()) {
272
- try {
273
- // Create formatters for UTC and target timezone
274
- const utcFormatter = new Intl.DateTimeFormat('en-US', {
275
- timeZone: 'UTC',
276
- year: 'numeric',
277
- month: 'numeric',
278
- day: 'numeric',
279
- hour: 'numeric',
280
- minute: 'numeric',
281
- hour12: false,
282
- });
283
- const tzFormatter = new Intl.DateTimeFormat('en-US', {
284
- timeZone: this._identifier,
285
- year: 'numeric',
286
- month: 'numeric',
287
- day: 'numeric',
288
- hour: 'numeric',
289
- minute: 'numeric',
290
- hour12: false,
291
- });
292
- const utcParts = this._parseIntlParts(utcFormatter.formatToParts(date));
293
- const tzParts = this._parseIntlParts(tzFormatter.formatToParts(date));
294
- const utcDate = new Date(Date.UTC(utcParts.year, utcParts.month - 1, utcParts.day, utcParts.hour, utcParts.minute));
295
- const tzDate = new Date(Date.UTC(tzParts.year, tzParts.month - 1, tzParts.day, tzParts.hour, tzParts.minute));
296
- // Add extra minutes for non-whole-hour offsets (e.g., +05:30)
297
- return ((tzDate.getTime() - utcDate.getTime()) / 60000 + this._extraMinutes);
298
- }
299
- catch (_a) {
300
- return this._extraMinutes;
301
- }
302
- }
303
- /**
304
- * Parse Intl formatter parts to components
305
- */
306
- _parseIntlParts(parts) {
307
- const result = { year: 0, month: 0, day: 0, hour: 0, minute: 0 };
308
- for (const part of parts) {
309
- switch (part.type) {
310
- case 'year':
311
- result.year = parseInt(part.value, 10);
312
- break;
313
- case 'month':
314
- result.month = parseInt(part.value, 10);
315
- break;
316
- case 'day':
317
- result.day = parseInt(part.value, 10);
318
- break;
319
- case 'hour':
320
- result.hour = parseInt(part.value, 10);
321
- break;
322
- case 'minute':
323
- result.minute = parseInt(part.value, 10);
324
- break;
325
- }
326
- }
327
- return result;
328
- }
329
- /**
330
- * Get UTC offset in hours for a given date
331
- */
332
- getOffsetHours(date = new Date()) {
333
- return this.getOffsetMinutes(date) / 60;
334
- }
335
- /**
336
- * Get UTC offset as string (e.g., "+05:30", "-08:00")
337
- */
338
- getOffsetString(date = new Date()) {
339
- const offsetMinutes = this.getOffsetMinutes(date);
340
- const sign = offsetMinutes >= 0 ? '+' : '-';
341
- const absMinutes = Math.abs(offsetMinutes);
342
- const hours = Math.floor(absMinutes / 60);
343
- const minutes = absMinutes % 60;
344
- return `${sign}${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;
345
- }
346
- /**
347
- * Get complete offset information
348
- */
349
- getOffset(date = new Date()) {
350
- const minutes = this.getOffsetMinutes(date);
351
- return {
352
- minutes,
353
- hours: minutes / 60,
354
- string: this.getOffsetString(date),
355
- };
356
- }
357
- // ============================================================================
358
- // DST (Daylight Saving Time)
359
- // ============================================================================
360
- /**
361
- * Check if DST is in effect for a given date
362
- */
363
- isDST(date = new Date()) {
364
- const jan = new Date(date.getFullYear(), 0, 1);
365
- const jul = new Date(date.getFullYear(), 6, 1);
366
- const janOffset = this.getOffsetMinutes(jan);
367
- const julOffset = this.getOffsetMinutes(jul);
368
- const currentOffset = this.getOffsetMinutes(date);
369
- // DST is in effect if current offset matches the larger offset
370
- const standardOffset = Math.min(janOffset, julOffset);
371
- return currentOffset !== standardOffset;
372
- }
373
- /**
374
- * Check if timezone observes DST
375
- */
376
- observesDST() {
377
- const currentYear = new Date().getFullYear();
378
- const jan = new Date(currentYear, 0, 15);
379
- const jul = new Date(currentYear, 6, 15);
380
- return this.getOffsetMinutes(jan) !== this.getOffsetMinutes(jul);
381
- }
382
- /**
383
- * Get the next DST transition
384
- */
385
- getNextDSTTransition(from = new Date()) {
386
- if (!this.observesDST()) {
387
- return null;
388
- }
389
- const currentOffset = this.getOffsetMinutes(from);
390
- const checkDate = new Date(from);
391
- // Search forward up to 1 year
392
- for (let i = 0; i < 366; i++) {
393
- checkDate.setDate(checkDate.getDate() + 1);
394
- const newOffset = this.getOffsetMinutes(checkDate);
395
- if (newOffset !== currentOffset) {
396
- // Found a transition, binary search for exact time
397
- const exactDate = this._findExactTransition(new Date(checkDate.getTime() - 24 * 60 * 60 * 1000), checkDate);
398
- return {
399
- date: exactDate,
400
- fromOffset: currentOffset,
401
- toOffset: newOffset,
402
- isDSTStart: newOffset > currentOffset,
403
- };
404
- }
405
- }
406
- return null;
407
- }
408
- /**
409
- * Binary search to find exact DST transition time
410
- */
411
- _findExactTransition(start, end) {
412
- const startOffset = this.getOffsetMinutes(start);
413
- while (end.getTime() - start.getTime() > 60000) {
414
- // Within 1 minute
415
- const mid = new Date((start.getTime() + end.getTime()) / 2);
416
- const midOffset = this.getOffsetMinutes(mid);
417
- if (midOffset === startOffset) {
418
- start = mid;
419
- }
420
- else {
421
- end = mid;
422
- }
423
- }
424
- return end;
425
- }
426
- // ============================================================================
427
- // Conversion
428
- // ============================================================================
429
- /**
430
- * Convert a date to this timezone (returns formatted string)
431
- */
432
- format(date, formatOptions) {
433
- const options = Object.assign({ timeZone: this._identifier }, formatOptions);
434
- return new Intl.DateTimeFormat('en-US', options).format(date);
435
- }
436
- /**
437
- * Get date components in this timezone
438
- */
439
- getComponents(date) {
440
- var _a;
441
- const formatter = new Intl.DateTimeFormat('en-US', {
442
- timeZone: this._identifier,
443
- year: 'numeric',
444
- month: 'numeric',
445
- day: 'numeric',
446
- hour: 'numeric',
447
- minute: 'numeric',
448
- second: 'numeric',
449
- weekday: 'short',
450
- hour12: false,
451
- });
452
- const parts = formatter.formatToParts(date);
453
- const result = {
454
- year: 0,
455
- month: 0,
456
- day: 0,
457
- hour: 0,
458
- minute: 0,
459
- second: 0,
460
- dayOfWeek: 0,
461
- };
462
- const dayMap = {
463
- Sun: 0,
464
- Mon: 1,
465
- Tue: 2,
466
- Wed: 3,
467
- Thu: 4,
468
- Fri: 5,
469
- Sat: 6,
470
- };
471
- for (const part of parts) {
472
- switch (part.type) {
473
- case 'year':
474
- result.year = parseInt(part.value, 10);
475
- break;
476
- case 'month':
477
- result.month = parseInt(part.value, 10);
478
- break;
479
- case 'day':
480
- result.day = parseInt(part.value, 10);
481
- break;
482
- case 'hour':
483
- result.hour = parseInt(part.value, 10);
484
- break;
485
- case 'minute':
486
- result.minute = parseInt(part.value, 10);
487
- break;
488
- case 'second':
489
- result.second = parseInt(part.value, 10);
490
- break;
491
- case 'weekday':
492
- result.dayOfWeek = (_a = dayMap[part.value]) !== null && _a !== void 0 ? _a : 0;
493
- break;
494
- }
495
- }
496
- return result;
497
- }
498
- /**
499
- * Convert a date from one timezone to another
500
- */
501
- static convert(date, from, to) {
502
- const fromTz = new ChronosTimezone(from);
503
- const toTz = new ChronosTimezone(to);
504
- const fromOffset = fromTz.getOffsetMinutes(date);
505
- const toOffset = toTz.getOffsetMinutes(date);
506
- const diffMinutes = toOffset - fromOffset;
507
- return new Date(date.getTime() + diffMinutes * 60000);
508
- }
509
- /**
510
- * Convert a UTC date to this timezone
511
- */
512
- fromUTC(date) {
513
- return ChronosTimezone.convert(date, 'UTC', this._identifier);
514
- }
515
- /**
516
- * Convert a date in this timezone to UTC
517
- */
518
- toUTC(date) {
519
- return ChronosTimezone.convert(date, this._identifier, 'UTC');
520
- }
521
- // ============================================================================
522
- // Information
523
- // ============================================================================
524
- /**
525
- * Get comprehensive timezone information
526
- */
527
- getInfo(date = new Date()) {
528
- var _a;
529
- return {
530
- identifier: (_a = this._originalOffset) !== null && _a !== void 0 ? _a : this._identifier,
531
- abbreviation: this.getAbbreviation(date),
532
- name: this.getFullName(date),
533
- offset: this.getOffset(date),
534
- isDST: this.isDST(date),
535
- observesDST: this.observesDST(),
536
- };
537
- }
538
- /**
539
- * Check if two timezones are equivalent at a given moment
540
- */
541
- equals(other, date = new Date()) {
542
- const otherTz = typeof other === 'string' ? new ChronosTimezone(other) : other;
543
- return this.getOffsetMinutes(date) === otherTz.getOffsetMinutes(date);
544
- }
545
- /**
546
- * Check if this is the same timezone identifier
547
- */
548
- isSame(other) {
549
- const otherIdentifier = typeof other === 'string' ? other : other.identifier;
550
- return this.identifier === otherIdentifier;
551
- }
552
- // ============================================================================
553
- // Static Utilities
554
- // ============================================================================
555
- /**
556
- * Get all available timezone identifiers
557
- * Note: This returns common timezones. Use Intl.supportedValuesOf('timeZone') for all.
558
- */
559
- static getAvailableTimezones() {
560
- // Try to use the native method if available
561
- if (typeof Intl !== 'undefined' && 'supportedValuesOf' in Intl) {
562
- try {
563
- return Intl.supportedValuesOf('timeZone');
564
- }
565
- catch (_a) {
566
- // Fall back to predefined list
567
- }
568
- }
569
- return Object.values(exports.TIMEZONES);
570
- }
571
- /**
572
- * Check if a timezone identifier is valid
573
- */
574
- static isValid(identifier) {
575
- try {
576
- new Intl.DateTimeFormat('en-US', { timeZone: identifier });
577
- return true;
578
- }
579
- catch (_a) {
580
- return false;
581
- }
582
- }
583
- /**
584
- * Get timezones grouped by region
585
- */
586
- static getTimezonesByRegion() {
587
- const timezones = ChronosTimezone.getAvailableTimezones();
588
- const grouped = {};
589
- for (const tz of timezones) {
590
- const parts = tz.split('/');
591
- const region = parts[0];
592
- if (!grouped[region]) {
593
- grouped[region] = [];
594
- }
595
- grouped[region].push(tz);
596
- }
597
- return grouped;
598
- }
599
- /**
600
- * Find timezones that match a given offset
601
- */
602
- static findByOffset(offsetHours, date = new Date()) {
603
- const targetMinutes = offsetHours * 60;
604
- const result = [];
605
- for (const tz of ChronosTimezone.getAvailableTimezones()) {
606
- const timezone = new ChronosTimezone(tz);
607
- if (timezone.getOffsetMinutes(date) === targetMinutes) {
608
- result.push(timezone);
609
- }
610
- }
611
- return result;
612
- }
613
- /**
614
- * Get current time in a specific timezone
615
- */
616
- static now(identifier) {
617
- const tz = new ChronosTimezone(identifier);
618
- return tz.fromUTC(new Date());
619
- }
620
- // ============================================================================
621
- // Serialization
622
- // ============================================================================
623
- /**
624
- * Convert to string
625
- */
626
- toString() {
627
- var _a;
628
- return (_a = this._originalOffset) !== null && _a !== void 0 ? _a : this._identifier;
629
- }
630
- /**
631
- * Convert to JSON
632
- */
633
- toJSON() {
634
- var _a;
635
- const now = new Date();
636
- return {
637
- identifier: (_a = this._originalOffset) !== null && _a !== void 0 ? _a : this._identifier,
638
- offset: this.getOffsetString(now),
639
- isDST: this.isDST(now),
640
- observesDST: this.observesDST(),
641
- };
642
- }
643
- /**
644
- * Get primitive value
645
- */
646
- valueOf() {
647
- var _a;
648
- return (_a = this._originalOffset) !== null && _a !== void 0 ? _a : this._identifier;
649
- }
650
- }
651
- exports.ChronosTimezone = ChronosTimezone;
652
- // ============================================================================
653
- // Common Timezone Aliases
654
- // ============================================================================
655
- /**
656
- * Pre-created timezone instances for common timezones
657
- */
658
- exports.Timezones = {
659
- UTC: ChronosTimezone.utc(),
660
- Local: ChronosTimezone.local(),
661
- // US
662
- Eastern: ChronosTimezone.create('America/New_York'),
663
- Central: ChronosTimezone.create('America/Chicago'),
664
- Mountain: ChronosTimezone.create('America/Denver'),
665
- Pacific: ChronosTimezone.create('America/Los_Angeles'),
666
- // Europe
667
- London: ChronosTimezone.create('Europe/London'),
668
- Paris: ChronosTimezone.create('Europe/Paris'),
669
- Berlin: ChronosTimezone.create('Europe/Berlin'),
670
- // Asia
671
- Tokyo: ChronosTimezone.create('Asia/Tokyo'),
672
- Shanghai: ChronosTimezone.create('Asia/Shanghai'),
673
- Singapore: ChronosTimezone.create('Asia/Singapore'),
674
- Dubai: ChronosTimezone.create('Asia/Dubai'),
675
- Mumbai: ChronosTimezone.create('Asia/Kolkata'),
676
- // Australia/Pacific
677
- Sydney: ChronosTimezone.create('Australia/Sydney'),
678
- Auckland: ChronosTimezone.create('Pacific/Auckland'),
679
- };