PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.8
Booking for Appointments and Events Calendar – Amelia v2.4.8
2.4.8 2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / sabre / vobject / lib / TimezoneGuesser / GuessFromMsTzId.php
ameliabooking / vendor / sabre / vobject / lib / TimezoneGuesser Last commit date
FindFromOffset.php 7 months ago FindFromTimezoneIdentifier.php 7 months ago FindFromTimezoneMap.php 7 months ago GuessFromLicEntry.php 7 months ago GuessFromMsTzId.php 7 months ago TimezoneFinder.php 7 months ago TimezoneGuesser.php 7 months ago
GuessFromMsTzId.php
120 lines
1 <?php
2
3 declare(strict_types=1);
4
5 namespace AmeliaVendor\Sabre\VObject\TimezoneGuesser;
6
7 use DateTimeZone;
8 use AmeliaVendor\Sabre\VObject\Component\VTimeZone;
9
10 class GuessFromMsTzId implements TimezoneGuesser
11 {
12 /**
13 * List of microsoft exchange timezone ids.
14 *
15 * Source: http://msdn.microsoft.com/en-us/library/aa563018(loband).aspx
16 */
17 public static $microsoftExchangeMap = [
18 0 => 'UTC',
19 31 => 'Africa/Casablanca',
20
21 // Insanely, id #2 is used for both Europe/Lisbon, and Europe/Sarajevo.
22 // I'm not even kidding.. We handle this special case in the
23 // getTimeZone method.
24 2 => 'Europe/Lisbon',
25 1 => 'Europe/London',
26 4 => 'Europe/Berlin',
27 6 => 'Europe/Prague',
28 3 => 'Europe/Paris',
29 69 => 'Africa/Luanda', // This was a best guess
30 7 => 'Europe/Athens',
31 5 => 'Europe/Bucharest',
32 49 => 'Africa/Cairo',
33 50 => 'Africa/Harare',
34 59 => 'Europe/Helsinki',
35 27 => 'Asia/Jerusalem',
36 26 => 'Asia/Baghdad',
37 74 => 'Asia/Kuwait',
38 51 => 'Europe/Moscow',
39 56 => 'Africa/Nairobi',
40 25 => 'Asia/Tehran',
41 24 => 'Asia/Muscat', // Best guess
42 54 => 'Asia/Baku',
43 48 => 'Asia/Kabul',
44 58 => 'Asia/Yekaterinburg',
45 47 => 'Asia/Karachi',
46 23 => 'Asia/Calcutta',
47 62 => 'Asia/Kathmandu',
48 46 => 'Asia/Almaty',
49 71 => 'Asia/Dhaka',
50 66 => 'Asia/Colombo',
51 61 => 'Asia/Rangoon',
52 22 => 'Asia/Bangkok',
53 64 => 'Asia/Krasnoyarsk',
54 45 => 'Asia/Shanghai',
55 63 => 'Asia/Irkutsk',
56 21 => 'Asia/Singapore',
57 73 => 'Australia/Perth',
58 75 => 'Asia/Taipei',
59 20 => 'Asia/Tokyo',
60 72 => 'Asia/Seoul',
61 70 => 'Asia/Yakutsk',
62 19 => 'Australia/Adelaide',
63 44 => 'Australia/Darwin',
64 18 => 'Australia/Brisbane',
65 76 => 'Australia/Sydney',
66 43 => 'Pacific/Guam',
67 42 => 'Australia/Hobart',
68 68 => 'Asia/Vladivostok',
69 41 => 'Asia/Magadan',
70 17 => 'Pacific/Auckland',
71 40 => 'Pacific/Fiji',
72 67 => 'Pacific/Tongatapu',
73 29 => 'Atlantic/Azores',
74 53 => 'Atlantic/Cape_Verde',
75 30 => 'America/Noronha',
76 8 => 'America/Sao_Paulo', // Best guess
77 32 => 'America/Argentina/Buenos_Aires',
78 60 => 'America/Godthab',
79 28 => 'America/St_Johns',
80 9 => 'America/Halifax',
81 33 => 'America/Caracas',
82 65 => 'America/Santiago',
83 35 => 'America/Bogota',
84 10 => 'America/New_York',
85 34 => 'America/Indiana/Indianapolis',
86 55 => 'America/Guatemala',
87 11 => 'America/Chicago',
88 37 => 'America/Mexico_City',
89 36 => 'America/Edmonton',
90 38 => 'America/Phoenix',
91 12 => 'America/Denver', // Best guess
92 13 => 'America/Los_Angeles', // Best guess
93 14 => 'America/Anchorage',
94 15 => 'Pacific/Honolulu',
95 16 => 'Pacific/Midway',
96 39 => 'Pacific/Kwajalein',
97 ];
98
99 public function guess(VTimeZone $vtimezone, bool $throwIfUnsure = false): ?DateTimeZone
100 {
101 // Microsoft may add a magic number, which we also have an
102 // answer for.
103 if (!isset($vtimezone->{'X-MICROSOFT-CDO-TZID'})) {
104 return null;
105 }
106 $cdoId = (int) $vtimezone->{'X-MICROSOFT-CDO-TZID'}->getValue();
107
108 // 2 can mean both Europe/Lisbon and Europe/Sarajevo.
109 if (2 === $cdoId && false !== strpos((string) $vtimezone->TZID, 'Sarajevo')) {
110 return new DateTimeZone('Europe/Sarajevo');
111 }
112
113 if (isset(self::$microsoftExchangeMap[$cdoId])) {
114 return new DateTimeZone(self::$microsoftExchangeMap[$cdoId]);
115 }
116
117 return null;
118 }
119 }
120