2 "This tests times that shouldn't happen because of DST, or times that happen twice"
6 "For times that shouldn't happen we currently go back an hour, but in reality we would like to go forward an hour. This has been filed as a radar: 4777813"
10 "For times that happen twice the behavior of all major browsers seems to be to pick the second occurance, i.e. Standard Time not Daylight Time"
14 if ((new Date(2009, 9, 1)).toString().match("PDT")) {
15 testCases
.push(["(new Date(1982, 2, 14, 2, 10)).getHours()", "1"]);
16 testCases
.push(["(new Date(1982, 2, 14, 2)).getHours()", "1"]);
17 testCases
.push(["(new Date(1982, 11, 7, 1, 10)).getTimezoneOffset()", "480"]);
18 testCases
.push(["(new Date(1982, 11, 7, 1)).getTimezoneOffset()", "480"]);
22 for (var i
= 0; i
< testCases
.length
; i
++) {
23 var actual
= eval(testCases
[i
][0]);
24 var expected
= eval(testCases
[i
][1]);
25 if (actual
!= expected
) {
26 errors
.push(testCases
[i
][0] + " should be " + testCases
[i
][1] + ". Was " + actual
+ ".");
31 testFailed(errors
.length
+ "/" + testCases
.length
+ " tests were failed: " + errors
.join(", "));
33 testPassed("Passed all tests (or skipped all tests if your timezone isn't PST/PDT)");