forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdate_cache_bug.js
More file actions
44 lines (36 loc) · 1.78 KB
/
date_cache_bug.js
File metadata and controls
44 lines (36 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
WScript.Echo("Checking for new Date() with DST issues: ");
WScript.Echo("Backward loop starts");
for (var working = new Date(2014, 2, 1) ; working.getFullYear() > 1940;)
{
var dayOfMonth = working.getDate();
var nextYear = working.getFullYear();
var nextMonth = working.getMonth();
dayOfMonth -= 1;
working = new Date(nextYear, nextMonth, dayOfMonth);
if (working.getHours() > 0)
{
WScript.Echo("" + working + " from:" + nextYear + "," + nextMonth + "," + dayOfMonth + "");
dayOfMonth--;
working = new Date(nextYear, nextMonth, dayOfMonth); //skip over this date
}
}
WScript.Echo("Forwards loop starts");
for (var working = new Date(1940, 0, 0) ; working.getFullYear() < 2014;)
{
var dayOfMonth = working.getDate();
var nextYear = working.getFullYear();
var nextMonth = working.getMonth();
dayOfMonth += 1;
working = new Date(nextYear, nextMonth, dayOfMonth);
if (working.getHours() > 0)
{
WScript.Echo("" + working + " from:" + nextYear + "," + nextMonth + "," + dayOfMonth + "");
dayOfMonth++;
working = new Date(nextYear, nextMonth, dayOfMonth); //skip over this date
}
}
WScript.Echo("done.");