annotate vendor/sabre/vobject/tests/VObject/DateTimeParserTest.php @ 38:ac106d4c8961 default tip

flip /etc/roundcube to point here
author Charlie Root
date Sat, 29 Dec 2018 05:39:53 -0500
parents 430dbd5346f7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
1 <?php
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
3 namespace Sabre\VObject;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
4
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
5 use DateTime;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
6 use DateTimeZone;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
7 use DateInterval;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
8
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
9 class DateTimeParserTest extends \PHPUnit_Framework_TestCase {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
10
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
11 function testParseICalendarDuration() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
12
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
13 $this->assertEquals('+1 weeks', DateTimeParser::parseDuration('P1W',true));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
14 $this->assertEquals('+5 days', DateTimeParser::parseDuration('P5D',true));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
15 $this->assertEquals('+5 days 3 hours 50 minutes 12 seconds', DateTimeParser::parseDuration('P5DT3H50M12S',true));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
16 $this->assertEquals('-1 weeks 50 minutes', DateTimeParser::parseDuration('-P1WT50M',true));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
17 $this->assertEquals('+50 days 3 hours 2 seconds', DateTimeParser::parseDuration('+P50DT3H2S',true));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
18 $this->assertEquals('+0 seconds', DateTimeParser::parseDuration('+PT0S',true));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
19 $this->assertEquals(new DateInterval('PT0S'), DateTimeParser::parseDuration('PT0S'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
20
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
21 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
22
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
23 function testParseICalendarDurationDateInterval() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
24
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
25 $expected = new DateInterval('P7D');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
26 $this->assertEquals($expected, DateTimeParser::parseDuration('P1W'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
27 $this->assertEquals($expected, DateTimeParser::parse('P1W'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
28
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
29 $expected = new DateInterval('PT3M');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
30 $expected->invert = true;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
31 $this->assertEquals($expected, DateTimeParser::parseDuration('-PT3M'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
32
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
33 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
34
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
35 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
36 * @expectedException LogicException
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
37 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
38 function testParseICalendarDurationFail() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
39
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
40 DateTimeParser::parseDuration('P1X',true);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
41
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
42 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
43
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
44 function testParseICalendarDateTime() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
45
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
46 $dateTime = DateTimeParser::parseDateTime('20100316T141405');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
47
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
48 $compare = new DateTime('2010-03-16 14:14:05',new DateTimeZone('UTC'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
49
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
50 $this->assertEquals($compare, $dateTime);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
51
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
52 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
53
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
54 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
55 * @depends testParseICalendarDateTime
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
56 * @expectedException LogicException
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
57 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
58 function testParseICalendarDateTimeBadFormat() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
59
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
60 $dateTime = DateTimeParser::parseDateTime('20100316T141405 ');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
61
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
62 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
63
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
64 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
65 * @depends testParseICalendarDateTime
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
66 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
67 function testParseICalendarDateTimeUTC() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
68
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
69 $dateTime = DateTimeParser::parseDateTime('20100316T141405Z');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
70
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
71 $compare = new DateTime('2010-03-16 14:14:05',new DateTimeZone('UTC'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
72 $this->assertEquals($compare, $dateTime);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
73
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
74 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
75
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
76 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
77 * @depends testParseICalendarDateTime
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
78 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
79 function testParseICalendarDateTimeUTC2() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
80
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
81 $dateTime = DateTimeParser::parseDateTime('20101211T160000Z');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
82
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
83 $compare = new DateTime('2010-12-11 16:00:00',new DateTimeZone('UTC'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
84 $this->assertEquals($compare, $dateTime);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
85
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
86 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
87
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
88 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
89 * @depends testParseICalendarDateTime
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
90 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
91 function testParseICalendarDateTimeCustomTimeZone() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
92
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
93 $dateTime = DateTimeParser::parseDateTime('20100316T141405', new DateTimeZone('Europe/Amsterdam'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
94
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
95 $compare = new DateTime('2010-03-16 14:14:05',new DateTimeZone('Europe/Amsterdam'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
96 $this->assertEquals($compare, $dateTime);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
97
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
98 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
99
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
100 function testParseICalendarDate() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
101
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
102 $dateTime = DateTimeParser::parseDate('20100316');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
103
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
104 $expected = new DateTime('2010-03-16 00:00:00',new DateTimeZone('UTC'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
105
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
106 $this->assertEquals($expected, $dateTime);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
107
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
108 $dateTime = DateTimeParser::parse('20100316');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
109 $this->assertEquals($expected, $dateTime);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
110
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
111 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
112
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
113 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
114 * TCheck if a date with year > 4000 will not throw an exception. iOS seems to use 45001231 in yearly recurring events
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
115 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
116 function testParseICalendarDateGreaterThan4000() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
117
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
118 $dateTime = DateTimeParser::parseDate('45001231');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
119
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
120 $expected = new DateTime('4500-12-31 00:00:00',new DateTimeZone('UTC'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
121
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
122 $this->assertEquals($expected, $dateTime);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
123
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
124 $dateTime = DateTimeParser::parse('45001231');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
125 $this->assertEquals($expected, $dateTime);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
126
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
127 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
128
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
129 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
130 * Check if a datetime with year > 4000 will not throw an exception. iOS seems to use 45001231T235959 in yearly recurring events
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
131 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
132 function testParseICalendarDateTimeGreaterThan4000() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
133
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
134 $dateTime = DateTimeParser::parseDateTime('45001231T235959');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
135
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
136 $expected = new DateTime('4500-12-31 23:59:59',new DateTimeZone('UTC'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
137
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
138 $this->assertEquals($expected, $dateTime);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
139
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
140 $dateTime = DateTimeParser::parse('45001231T235959');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
141 $this->assertEquals($expected, $dateTime);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
142
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
143 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
144
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
145 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
146 * @depends testParseICalendarDate
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
147 * @expectedException LogicException
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
148 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
149 function testParseICalendarDateBadFormat() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
150
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
151 $dateTime = DateTimeParser::parseDate('20100316T141405');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
152
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
153 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
154
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
155 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
156 * @dataProvider vcardDates
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
157 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
158 function testVCardDate($input, $output) {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
159
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
160 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
161 $output,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
162 DateTimeParser::parseVCardDateTime($input)
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
163 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
164
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
165 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
166
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
167 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
168 * @dataProvider vcardDates
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
169 * @expectedException \InvalidArgumentException
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
170 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
171 function testBadVCardDate() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
172
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
173 DateTimeParser::parseVCardDateTime('1985---01');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
174
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
175 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
176
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
177 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
178 * @dataProvider vcardDates
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
179 * @expectedException \InvalidArgumentException
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
180 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
181 function testBadVCardTime() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
182
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
183 DateTimeParser::parseVCardTime('23:12:166');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
184
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
185 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
186
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
187 function vcardDates() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
188
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
189 return array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
190 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
191 "19961022T140000",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
192 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
193 "year" => 1996,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
194 "month" => 10,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
195 "date" => 22,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
196 "hour" => 14,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
197 "minute" => 00,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
198 "second" => 00,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
199 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
200 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
201 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
202 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
203 "--1022T1400",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
204 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
205 "year" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
206 "month" => 10,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
207 "date" => 22,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
208 "hour" => 14,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
209 "minute" => 00,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
210 "second" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
211 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
212 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
213 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
214 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
215 "---22T14",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
216 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
217 "year" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
218 "month" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
219 "date" => 22,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
220 "hour" => 14,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
221 "minute" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
222 "second" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
223 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
224 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
225 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
226 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
227 "19850412",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
228 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
229 "year" => 1985,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
230 "month" => 4,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
231 "date" => 12,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
232 "hour" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
233 "minute" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
234 "second" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
235 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
236 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
237 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
238 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
239 "1985-04",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
240 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
241 "year" => 1985,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
242 "month" => 04,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
243 "date" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
244 "hour" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
245 "minute" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
246 "second" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
247 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
248 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
249 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
250 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
251 "1985",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
252 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
253 "year" => 1985,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
254 "month" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
255 "date" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
256 "hour" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
257 "minute" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
258 "second" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
259 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
260 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
261 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
262 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
263 "--0412",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
264 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
265 "year" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
266 "month" => 4,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
267 "date" => 12,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
268 "hour" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
269 "minute" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
270 "second" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
271 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
272 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
273 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
274 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
275 "---12",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
276 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
277 "year" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
278 "month" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
279 "date" => 12,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
280 "hour" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
281 "minute" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
282 "second" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
283 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
284 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
285 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
286 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
287 "T102200",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
288 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
289 "year" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
290 "month" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
291 "date" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
292 "hour" => 10,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
293 "minute" => 22,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
294 "second" => 0,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
295 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
296 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
297 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
298 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
299 "T1022",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
300 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
301 "year" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
302 "month" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
303 "date" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
304 "hour" => 10,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
305 "minute" => 22,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
306 "second" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
307 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
308 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
309 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
310 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
311 "T10",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
312 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
313 "year" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
314 "month" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
315 "date" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
316 "hour" => 10,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
317 "minute" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
318 "second" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
319 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
320 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
321 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
322 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
323 "T-2200",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
324 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
325 "year" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
326 "month" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
327 "date" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
328 "hour" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
329 "minute" => 22,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
330 "second" => 00,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
331 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
332 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
333 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
334 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
335 "T--00",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
336 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
337 "year" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
338 "month" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
339 "date" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
340 "hour" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
341 "minute" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
342 "second" => 00,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
343 "timezone" => null
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
344 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
345 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
346 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
347 "T102200Z",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
348 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
349 "year" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
350 "month" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
351 "date" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
352 "hour" => 10,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
353 "minute" => 22,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
354 "second" => 00,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
355 "timezone" => 'Z'
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
356 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
357 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
358 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
359 "T102200-0800",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
360 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
361 "year" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
362 "month" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
363 "date" => null,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
364 "hour" => 10,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
365 "minute" => 22,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
366 "second" => 00,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
367 "timezone" => '-0800'
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
368 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
369 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
370
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
371 // extended format
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
372 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
373 "2012-11-29T15:10:53Z",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
374 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
375 "year" => 2012,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
376 "month" => 11,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
377 "date" => 29,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
378 "hour" => 15,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
379 "minute" => 10,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
380 "second" => 53,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
381 "timezone" => 'Z'
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
382 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
383 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
384 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
385
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
386 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
387
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
388
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
389 }