]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - extlib/Date/tests/calc.php
[PEAR] Modernize Validate code
[quix0rs-gnu-social.git] / extlib / Date / tests / calc.php
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
3
4 /**
5  * Tests for the Date_Calc class
6  *
7  * Any individual tests that fail will have their name, expected result
8  * and actual result printed out.  So seeing no output when executing
9  * this file is a good thing.
10  *
11  * Can be run via CLI or a web server.
12  *
13  * This test senses whether it is from an installation of PEAR::Date or if
14  * it's from CVS or a .tar file.  If it's an installed version, use the
15  * installed version of Date_Calc.  Otherwise, use the local development
16  * copy of Date_Calc.
17  *
18  * PHP versions 4 and 5
19  *
20  * LICENSE:
21  *
22  * Copyright (c) 1997-2005 Daniel Convissor <danielc@php.net>
23  * All rights reserved.
24  *
25  * This source file is subject to the New BSD license that is bundled
26  * with this package in the file LICENSE.txt.
27  * It is also available through the world-wide-web at this URL:
28  * http://www.opensource.org/licenses/bsd-license.php
29  * If you did not receive a copy of the license and are unable to
30  * obtain it through the world-wide-web, please send an email
31  * to pear-dev@lists.php.net so we can send you a copy immediately.
32  *
33  * @category   Date and Time
34  * @package    Date
35  * @author     Daniel Convissor <danielc@php.net>
36  * @copyright  Copyright (c) 1997-2005 Daniel Convissor <danielc@php.net>
37  * @license    http://www.opensource.org/licenses/bsd-license.php
38  *             BSD License
39  * @version    CVS: $Id$
40  * @link       http://pear.php.net/package/Date
41  * @since      File available since Release 1.5
42  */
43
44 if ('@include_path@' != '@' . 'include_path' . '@') {
45     ini_set(
46         'include_path',
47         ini_get('include_path')
48         . PATH_SEPARATOR . '.'
49     );
50 } else {
51     ini_set(
52         'include_path',
53         realpath(dirname(__FILE__) . '/../')
54         . PATH_SEPARATOR . '.' . PATH_SEPARATOR
55         . ini_get('include_path')
56     );
57 }
58
59 /**
60  * Get the needed class
61  */
62 require_once 'Date/Calc.php';
63
64 /**
65  * Compare the test result to the expected result
66  *
67  * If the test fails, echo out the results.
68  *
69  * @param mixed $expect the scalar or array you expect from the test
70  * @param mixed $actual the scalar or array results from the test
71  * @param string $test_name the name of the test
72  *
73  * @return void
74  */
75 function compare($expect, $actual, $test_name)
76 {
77     if (is_array($expect)) {
78         if (count(array_diff($actual, $expect))) {
79             echo "$test_name failed.  Expect:\n";
80             print_r($expect);
81             echo "Actual:\n";
82             print_r($actual);
83         }
84     } else {
85         if ($expect != $actual) {
86             echo "$test_name failed.  Expect: $expect.  Actual: $actual\n";
87         }
88     }
89 }
90
91 if (php_sapi_name() != 'cli') {
92     echo "<pre>\n";
93 }
94
95
96 compare('20001122', Date_Calc::dateFormat(22, 11, 2000, '%Y%m%d'), 'dateFormat');
97 compare('20001122', Date_Calc::dateFormat('22', '11', '2000', '%Y%m%d'), 'dateFormat str');
98
99 compare('2001', Date_Calc::defaultCentury('1'), 'defaultCentury 1 str');
100 compare('2001', Date_Calc::defaultCentury(1), 'defaultCentury 1');
101 compare('1960', Date_Calc::defaultCentury(60), 'defaultCentury 2');
102 compare('2010', Date_Calc::defaultCentury(10), 'defaultCentury 3');
103
104 compare(2451871, Date_Calc::dateToDays('22', '11', '2000'), 'dateToDays str');
105 compare(2451871, Date_Calc::dateToDays(22, 11, 2000), 'dateToDays');
106 compare('20001122', Date_Calc::daysToDate(2451871), 'daysToDate');
107
108 compare('2000-47-3', Date_Calc::gregorianToISO('22', '11', '2000'), 'gregorianToISO str');
109 compare('2000-47-3', Date_Calc::gregorianToISO(22, 11, 2000), 'gregorianToISO');
110 compare(2451716.56767, Date_Calc::dateSeason('SUMMERSOLSTICE', 2000), 'dateSeason');
111
112 compare(date('Ymd'), Date_Calc::dateNow(), 'dateNow');
113 compare(date('Y'), Date_Calc::getYear(), 'getYear');
114 compare(date('m'), Date_Calc::getMonth(), 'getMonth');
115 compare(date('d'), Date_Calc::getDay(), 'getDay');
116
117 compare(327, Date_Calc::dayOfYear(22, 11, 2000), 'dayOfYear');
118 compare('November', Date_Calc::getMonthFullname(11), 'getMonthFullname');
119 compare('Nov', Date_Calc::getMonthAbbrname(11), 'getMonthAbbrname');
120 compare('Saturday', Date_Calc::getWeekdayFullname(1, 1, 2005), 'getWeekdayFullname');
121 compare('Sat', Date_Calc::getWeekdayAbbrname(1, 1, 2005), 'getWeekdayAbbrname');
122 compare(11, Date_Calc::getMonthFromFullName('November'), 'getMonthFromFullName');
123
124 compare(327, Date_Calc::dayOfYear('22', '11', '2000'), 'dayOfYear str');
125 compare('November', Date_Calc::getMonthFullname('11'), 'getMonthFullname str');
126 compare('Nov', Date_Calc::getMonthAbbrname('11'), 'getMonthAbbrname str');
127 compare('Saturday', Date_Calc::getWeekdayFullname('01', '01', '2005'), 'getWeekdayFullname str');
128 compare('Sat', Date_Calc::getWeekdayAbbrname('01', '01', '2005'), 'getWeekdayAbbrname str');
129
130 $exp = array(
131     'January',
132     'February',
133     'March',
134     'April',
135     'May',
136     'June',
137     'July',
138     'August',
139     'September',
140     'October',
141     'November',
142     'December'
143 );
144 compare($exp, Date_Calc::getMonthNames(), 'getMonthNames');
145
146 $exp = array(
147     'Monday',
148     'Tuesday',
149     'Wednesday',
150     'Thursday',
151     'Friday',
152     'Saturday',
153     'Sunday'
154 );
155 compare($exp, Date_Calc::getWeekDays(), 'getWeekDays');
156
157 compare(3, Date_Calc::dayOfWeek(22, 11, 2000), 'dayOfWeek');
158 compare(47, Date_Calc::weekOfYear(22, 11, 2000), 'weekOfYear');
159 compare(4, Date_Calc::quarterOfYear(22, 11, 2000), 'quarterOfYear');
160
161 compare(3, Date_Calc::dayOfWeek('22', '11', '2000'), 'dayOfWeek str');
162 compare(47, Date_Calc::weekOfYear('22', '11', '2000'), 'weekOfYear str');
163 compare(4, Date_Calc::quarterOfYear('22', '11', '2000'), 'quarterOfYear str');
164
165 compare(28, Date_Calc::daysInMonth(2, 1900), 'daysInMonth 1');
166 compare(29, Date_Calc::daysInMonth(2, 1996), 'daysInMonth 2');
167 compare(29, Date_Calc::daysInMonth(2, 2000), 'daysInMonth 3');
168 compare(28, Date_Calc::daysInMonth(2, 2001), 'daysInMonth 4');
169 compare(30, Date_Calc::daysInMonth(11, 2000), 'daysInMonth 5');
170
171 compare(28, Date_Calc::daysInMonth('02', 1900), 'daysInMonth 1 str');
172 compare(29, Date_Calc::daysInMonth('02', 1996), 'daysInMonth 2 str');
173 compare(29, Date_Calc::daysInMonth('02', 2000), 'daysInMonth 3 str');
174 compare(28, Date_Calc::daysInMonth('02', 2001), 'daysInMonth 4 str');
175 compare(30, Date_Calc::daysInMonth('11', '2000'), 'daysInMonth 5 str');
176
177 compare(5, Date_Calc::weeksInMonth(11, 2000), 'weeksInMonth');
178 compare(5, Date_Calc::weeksInMonth('11', '2000'), 'weeksInMonth str');
179
180
181 $exp = array(
182     '19000226',
183     '19000227',
184     '19000228',
185     '19000301',
186     '19000302',
187     '19000303',
188     '19000304',
189 );
190 compare($exp, Date_Calc::getCalendarWeek(27, 2, 1900), 'getCalendarWeek 1');
191
192 $exp = array(
193     '20000228',
194     '20000229',
195     '20000301',
196     '20000302',
197     '20000303',
198     '20000304',
199     '20000305',
200 );
201 compare($exp, Date_Calc::getCalendarWeek(28, 2, 2000), 'getCalendarWeek 2');
202
203 $exp = array(
204     '20001127',
205     '20001128',
206     '20001129',
207     '20001130',
208     '20001201',
209     '20001202',
210     '20001203'
211 );
212 compare($exp, Date_Calc::getCalendarWeek(27, 11, 2000), 'getCalendarWeek 3');
213 compare($exp, Date_Calc::getCalendarWeek('27', '11', '2000'), 'getCalendarWeek 3 str');
214
215 $exp = array(
216     array(
217         '20001030',
218         '20001031',
219         '20001101',
220         '20001102',
221         '20001103',
222         '20001104',
223     ),
224     array(
225         '20001105',
226         '20001106',
227         '20001107',
228         '20001108',
229         '20001109',
230         '20001110',
231         '20001111',
232     ),
233     array(
234         '20001112',
235         '20001113',
236         '20001114',
237         '20001115',
238         '20001116',
239         '20001117',
240         '20001118',
241     ),
242     array(
243         '20001119',
244         '20001121',
245         '20001122',
246         '20001123',
247         '20001124',
248         '20001125',
249         '20001126',
250     ),
251     array(
252         '20001127',
253         '20001128',
254         '20001129',
255         '20001130',
256         '20001201',
257         '20001202',
258         '20001203'
259     )
260 );
261 compare($exp, Date_Calc::getCalendarMonth(11, 2000), 'getCalendarMonth');
262 compare($exp, Date_Calc::getCalendarMonth('11', '2000'), 'getCalendarMonth str');
263
264 // I don't feel like dealing with this right now...
265 //compare('', Date_Calc::getCalendarYear(2000), 'getCalendarYear');
266
267 compare('20001121', Date_Calc::prevDay(22, 11, 2000), 'prevDay');
268 compare('20001123', Date_Calc::nextDay(22, 11, 2000), 'nextDay');
269 compare('20001121', Date_Calc::prevDay(22, 11, 2000), 'prevDay str');
270 compare('20001123', Date_Calc::nextDay('22', '11', '2000'), 'nextDay str');
271
272 compare('20001117', Date_Calc::prevWeekday('19', '11', '2000'), 'prevWeekday 1 str');
273 compare('20001117', Date_Calc::prevWeekday(19, 11, 2000), 'prevWeekday 1');
274 compare('20001121', Date_Calc::prevWeekday(22, 11, 2000), 'prevWeekday 2');
275 compare('20001123', Date_Calc::nextWeekday(22, 11, 2000), 'nextWeekday 1');
276 compare('20001127', Date_Calc::nextWeekday(24, 11, 2000), 'nextWeekday 2');
277 compare('20001127', Date_Calc::nextWeekday('24', '11', '2000'), 'nextWeekday 2 str');
278
279 compare('20001121', Date_Calc::prevDayOfWeek('2', '22', '11', '2000'), 'prevDayOfWeek 1 str');
280 compare('20001121', Date_Calc::prevDayOfWeek(2, 22, 11, 2000), 'prevDayOfWeek 1');
281 compare('20001115', Date_Calc::prevDayOfWeek(3, 22, 11, 2000), 'prevDayOfWeek 2');
282 compare('20001122', Date_Calc::prevDayOfWeek(3, 22, 11, 2000, '%Y%m%d', true), 'prevDayOfWeek 3');
283 compare('20001122', Date_Calc::nextDayOfWeek(3, 22, 11, 2000, '%Y%m%d', true), 'nextDayOfWeek 1');
284 compare('20001129', Date_Calc::nextDayOfWeek(3, 22, 11, 2000), 'nextDayOfWeek 2');
285 compare('20001123', Date_Calc::nextDayOfWeek(4, 22, 11, 2000), 'nextDayOfWeek 3');
286 compare('20001123', Date_Calc::nextDayOfWeek('4', '22', '11', '2000'), 'nextDayOfWeek 3 str');
287
288 compare('20001121', Date_Calc::prevDayOfWeekOnOrBefore('2', '22', '11', '2000'), 'prevDayOfWeekOnOrBefore 1 str');
289 compare('20001121', Date_Calc::prevDayOfWeekOnOrBefore(2, 22, 11, 2000), 'prevDayOfWeekOnOrBefore 1');
290 compare('20001122', Date_Calc::prevDayOfWeekOnOrBefore(3, 22, 11, 2000), 'prevDayOfWeekOnOrBefore 2');
291 compare('20001122', Date_Calc::nextDayOfWeekOnOrAfter(3, 22, 11, 2000), 'nextDayOfWeekOnOrAfter 1');
292 compare('20001123', Date_Calc::nextDayOfWeekOnOrAfter(4, 22, 11, 2000), 'nextDayOfWeekOnOrAfter 2');
293 compare('20001123', Date_Calc::nextDayOfWeekOnOrAfter('4', '22', '11', '2000'), 'nextDayOfWeekOnOrAfter 2 str');
294
295 compare('20001120', Date_Calc::beginOfWeek('22', '11', '2000'), 'beginOfWeek str');
296 compare('20001120', Date_Calc::beginOfWeek(22, 11, 2000), 'beginOfWeek');
297 compare('20001126', Date_Calc::endOfWeek(22, 11, 2000), 'endOfWeek');
298 compare('20001126', Date_Calc::endOfWeek('22', '11', '2000'), 'endOfWeek str');
299
300 compare('20001113', Date_Calc::beginOfPrevWeek(22, 11, 2000), 'beginOfPrevWeek');
301 compare('20001127', Date_Calc::beginOfNextWeek(22, 11, 2000), 'beginOfNextWeek');
302 compare('20001113', Date_Calc::beginOfPrevWeek('22', '11', '2000'), 'beginOfPrevWeek str');
303 compare('20001127', Date_Calc::beginOfNextWeek('22', '11', '2000'), 'beginOfNextWeek str');
304
305 compare('20001101', Date_Calc::beginOfMonth(11, 2000), 'beginOfMonth');
306 compare('20001101', Date_Calc::beginOfMonth('11', '2000'), 'beginOfMonth str');
307
308 compare('20001001', Date_Calc::beginOfPrevMonth(22, 11, 2000), 'beginOfPrevMonth');
309 compare('20001031', Date_Calc::endOfPrevMonth(22, 11, 2000), 'endOfPrevMonth');
310 compare('20001001', Date_Calc::beginOfPrevMonth('22', '11', '2000'), 'beginOfPrevMonth str');
311 compare('20001031', Date_Calc::endOfPrevMonth('22', '11', '2000'), 'endOfPrevMonth str');
312
313 compare('20001201', Date_Calc::beginOfNextMonth(22, 11, 2000), 'beginOfNextMonth');
314 compare('20001231', Date_Calc::endOfNextMonth(22, 11, 2000), 'endOfNextMonth');
315 compare('20001201', Date_Calc::beginOfNextMonth('22', '11', '2000'), 'beginOfNextMonth str');
316 compare('20001231', Date_Calc::endOfNextMonth('22', '11', '2000'), 'endOfNextMonth str');
317
318 compare('19991001', Date_Calc::beginOfMonthBySpan(-13, 11, 2000), 'beginOfMonthBySpan 1');
319 compare('20001001', Date_Calc::beginOfMonthBySpan(-1, 11, 2000), 'beginOfMonthBySpan 2');
320 compare('20001101', Date_Calc::beginOfMonthBySpan(0, 11, 2000), 'beginOfMonthBySpan 3');
321 compare('20001201', Date_Calc::beginOfMonthBySpan(1, 11, 2000), 'beginOfMonthBySpan 4');
322 compare('20011201', Date_Calc::beginOfMonthBySpan(13, 11, 2000), 'beginOfMonthBySpan 5');
323
324 compare('19990101', Date_Calc::beginOfMonthBySpan('-13', '02', '2000'), 'beginOfMonthBySpan 6 str');
325 compare('19990101', Date_Calc::beginOfMonthBySpan(-13, 2, 2000), 'beginOfMonthBySpan 6');
326 compare('20000101', Date_Calc::beginOfMonthBySpan(-1, 2, 2000), 'beginOfMonthBySpan 7');
327 compare('20000201', Date_Calc::beginOfMonthBySpan(0, 2, 2000), 'beginOfMonthBySpan 8');
328 compare('20000301', Date_Calc::beginOfMonthBySpan(1, 2, 2000), 'beginOfMonthBySpan 9');
329 compare('20010301', Date_Calc::beginOfMonthBySpan(13, 2, 2000), 'beginOfMonthBySpan 10');
330 compare('20010301', Date_Calc::beginOfMonthBySpan('13', '02', '2000'), 'beginOfMonthBySpan 10 str');
331
332 compare('19991031', Date_Calc::endOfMonthBySpan(-13, 11, 2000), 'endOfMonthBySpan 1');
333 compare('20001031', Date_Calc::endOfMonthBySpan(-1, 11, 2000), 'endOfMonthBySpan 2');
334 compare('20001130', Date_Calc::endOfMonthBySpan(0, 11, 2000), 'endOfMonthBySpan 3');
335 compare('20001231', Date_Calc::endOfMonthBySpan(1, 11, 2000), 'endOfMonthBySpan 4');
336 compare('20011231', Date_Calc::endOfMonthBySpan(13, 11, 2000), 'endOfMonthBySpan 5');
337
338 compare('19990131', Date_Calc::endOfMonthBySpan('-13', '02', '2000'), 'endOfMonthBySpan 6 str');
339 compare('19990131', Date_Calc::endOfMonthBySpan(-13, 2, 2000), 'endOfMonthBySpan 6');
340 compare('20000131', Date_Calc::endOfMonthBySpan(-1, 2, 2000), 'endOfMonthBySpan 7');
341 compare('20000229', Date_Calc::endOfMonthBySpan(0, 2, 2000), 'endOfMonthBySpan 8');
342 compare('20000331', Date_Calc::endOfMonthBySpan(1, 2, 2000), 'endOfMonthBySpan 9');
343 compare('20010331', Date_Calc::endOfMonthBySpan(13, 2, 2000), 'endOfMonthBySpan 10');
344 compare('20010331', Date_Calc::endOfMonthBySpan('13', '02', '2000'), 'endOfMonthBySpan 10 str');
345
346 compare(3, Date_Calc::firstOfMonthWeekday(11, 2000), 'firstOfMonthWeekday');
347 compare(3, Date_Calc::firstOfMonthWeekday('11', '2000'), 'firstOfMonthWeekday str');
348
349 compare('20050101', Date_Calc::NWeekdayOfMonth(1, 6, 1, 2005), 'NWeekdayOfMonth 161');
350 compare('20050102', Date_Calc::NWeekdayOfMonth(1, 0, 1, 2005), 'NWeekdayOfMonth 101');
351 compare('20050103', Date_Calc::NWeekdayOfMonth(1, 1, 1, 2005), 'NWeekdayOfMonth 111');
352 compare('20050104', Date_Calc::NWeekdayOfMonth(1, 2, 1, 2005), 'NWeekdayOfMonth 121');
353 compare('20050105', Date_Calc::NWeekdayOfMonth(1, 3, 1, 2005), 'NWeekdayOfMonth 131');
354 compare('20050106', Date_Calc::NWeekdayOfMonth(1, 4, 1, 2005), 'NWeekdayOfMonth 141');
355 compare('20050107', Date_Calc::NWeekdayOfMonth(1, 5, 1, 2005), 'NWeekdayOfMonth 151');
356
357 compare('20050108', Date_Calc::NWeekdayOfMonth('2', '6', '01', '2005'), 'NWeekdayOfMonth 261');
358 compare('20050109', Date_Calc::NWeekdayOfMonth('2', '0', '01', '2005'), 'NWeekdayOfMonth 201');
359 compare('20050110', Date_Calc::NWeekdayOfMonth('2', '1', '01', '2005'), 'NWeekdayOfMonth 211');
360 compare('20050111', Date_Calc::NWeekdayOfMonth('2', '2', '01', '2005'), 'NWeekdayOfMonth 221');
361 compare('20050112', Date_Calc::NWeekdayOfMonth('2', '3', '01', '2005'), 'NWeekdayOfMonth 231');
362 compare('20050113', Date_Calc::NWeekdayOfMonth('2', '4', '01', '2005'), 'NWeekdayOfMonth 241');
363 compare('20050114', Date_Calc::NWeekdayOfMonth('2', '5', '01', '2005'), 'NWeekdayOfMonth 251');
364
365 compare('20050131', Date_Calc::NWeekdayOfMonth('last', 1, 1, 2005), 'NWeekdayOfMonth l11');
366 compare('20050130', Date_Calc::NWeekdayOfMonth('last', 0, 1, 2005), 'NWeekdayOfMonth l01');
367 compare('20050129', Date_Calc::NWeekdayOfMonth('last', 6, 1, 2005), 'NWeekdayOfMonth l61');
368 compare('20050128', Date_Calc::NWeekdayOfMonth('last', 5, 1, 2005), 'NWeekdayOfMonth l51');
369 compare('20050127', Date_Calc::NWeekdayOfMonth('last', 4, 1, 2005), 'NWeekdayOfMonth l41');
370 compare('20050126', Date_Calc::NWeekdayOfMonth('last', 3, 1, 2005), 'NWeekdayOfMonth l31');
371 compare('20050125', Date_Calc::NWeekdayOfMonth('last', 2, 1, 2005), 'NWeekdayOfMonth l21');
372
373 compare('20050331', Date_Calc::NWeekdayOfMonth('last', 4, 3, 2005), 'NWeekdayOfMonth l43');
374 compare('20050330', Date_Calc::NWeekdayOfMonth('last', 3, 3, 2005), 'NWeekdayOfMonth l33');
375 compare('20050329', Date_Calc::NWeekdayOfMonth('last', 2, 3, 2005), 'NWeekdayOfMonth l23');
376 compare('20050328', Date_Calc::NWeekdayOfMonth('last', 1, 3, 2005), 'NWeekdayOfMonth l13');
377 compare('20050327', Date_Calc::NWeekdayOfMonth('last', 0, 3, 2005), 'NWeekdayOfMonth l03');
378 compare('20050326', Date_Calc::NWeekdayOfMonth('last', 6, 3, 2005), 'NWeekdayOfMonth l63');
379 compare('20050325', Date_Calc::NWeekdayOfMonth('last', 5, 3, 2005), 'NWeekdayOfMonth l53');
380
381
382 compare(false, Date_Calc::isValidDate(29, 2, 1900), 'isValidDate 1');
383 compare(true, Date_Calc::isValidDate(29, 2, 2000), 'isValidDate 2');
384 compare(true, Date_Calc::isValidDate('29', '02', '2000'), 'isValidDate 2 str');
385
386 compare(false, Date_Calc::isLeapYear(1900), 'isLeapYear 1');
387 compare(true, Date_Calc::isLeapYear(1996), 'isLeapYear 2');
388 compare(true, Date_Calc::isLeapYear(2000), 'isLeapYear 3');
389 compare(false, Date_Calc::isLeapYear(2001), 'isLeapYear 4');
390 compare(false, Date_Calc::isLeapYear('2001'), 'isLeapYear 4 str');
391
392 compare(false, Date_Calc::isFutureDate('22', '11', '2000'), 'isFutureDate 1 str');
393 compare(false, Date_Calc::isFutureDate(22, 11, 2000), 'isFutureDate 1');
394 compare(true, Date_Calc::isFutureDate(22, 11, date('Y') + 1), 'isFutureDate 2');
395
396 compare(false, Date_Calc::isPastDate(22, 11, date('Y') + 1), 'isPastDate 1');
397 compare(true, Date_Calc::isPastDate(22, 11, 2000), 'isPastDate 2');
398 compare(true, Date_Calc::isPastDate('22', '11', '2000'), 'isPastDate 2 str');
399
400 compare(10, Date_Calc::dateDiff(22, 11, 2000, 12, 11, 2000), 'dateDiff 1');
401 compare(10, Date_Calc::dateDiff(12, 11, 2000, 22, 11, 2000), 'dateDiff 2');
402 compare(61, Date_Calc::dateDiff(22, 11, 2000, 22, 1, 2001), 'dateDiff 3');
403 compare(61, Date_Calc::dateDiff('22', '11', '2000', '22', '01', '2001'), 'dateDiff 3 str');
404
405 compare(-1, Date_Calc::compareDates(12, 11, 2000, 22, 11, 2000), 'compareDates 1');
406 compare(0, Date_Calc::compareDates(22, 11, 2000, 22, 11, 2000), 'compareDates 2');
407 compare(1, Date_Calc::compareDates(22, 11, 2000, 12, 11, 2000), 'compareDates 3');
408 compare(1, Date_Calc::compareDates('22', '11', '2000', '12', '11', '2000'), 'compareDates 3 str');