Fix comment and revert changes in DST transition test as requested.
[dygraphs.git] / tests / daylight-savings.html
CommitLineData
54425b14 1<!DOCTYPE html>
d1bce5a0
DV
2<html>
3 <head>
10494b48 4 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
d1bce5a0
DV
5 <title>Daylight Savings</title>
6 <!--[if IE]>
7 <script type="text/javascript" src="../excanvas.js"></script>
8 <![endif]-->
7e5ddc94
DV
9 <!--
10 For production (minified) code, use:
11 <script type="text/javascript" src="dygraph-combined.js"></script>
12 -->
13 <script type="text/javascript" src="../dygraph-dev.js"></script>
14
0b4cf8f0
DV
15 <style>
16 body {
17 max-width: 1024px;
18 }
19 </style>
20
d1bce5a0
DV
21 </head>
22 <body>
23 <h2>DST</h2>
24 <p>This tests that tick marks don't break when the axis crosses into
25 daylight savings time.</p>
26
27 <div id="demodiv"></div>
28
35a3b119
DV
29 <p>The tick marks should all be on day boundaries or nice hours (6, 12, 18),
30 rather than on odd time boundaries like 5, 11, 17 and 23.</p>
31
fef315fe
DV
32 <hr/>
33 <div id="chart2"></div>
aaaf030e
JPB
34 <p>This chart shows a continuous line going across the "fall back" EST/EDT event.
35 You may need to switch your computer's time zone to Eastern to see this.
36 The x-axis tick marks go from 01:00 &rarr; 01:55 and then back to 01:00.</p>
fef315fe 37
0b4cf8f0
DV
38 <hr/>
39 <div id="chart3"></div>
40 <p>This chart is analogous to the first, except at a "spring forward".</p>
41
42 <hr/>
43 <div id="chart4"></div>
aaaf030e
JPB
44 <p>This chart shows a continuous series which crosses a "spring forward".
45 The x-axis ticks should skip from 1:50AM to 3:00AM.</p>
0b4cf8f0 46
d1bce5a0
DV
47 <script type="text/javascript">
48 g = new Dygraph(
49 document.getElementById("demodiv"),
50"Date/Time,Purchases\n" +
51"2010-11-05 00:00:00,167082\n" +
52"2010-11-06 00:00:00,168571\n" +
53"2010-11-07 00:00:00,177796\n" +
54"2010-11-08 00:00:00,165587\n" +
35a3b119 55"2010-11-09 00:00:00,164380\n",
0f9bf369
DV
56 {
57 width: 1024
58 }
d1bce5a0 59 );
fef315fe
DV
60
61 // Generate data which crosses the EST/EDT boundary.
62 var dst_data = [];
aaaf030e
JPB
63 var base_ms = 1383453600000;
64 for (var x = base_ms; x < base_ms + 1000 * 60 * 160; x += 1000) {
fef315fe
DV
65 dst_data.push([new Date(x), x]);
66 }
67
0b4cf8f0 68 g2 = new Dygraph(
fef315fe
DV
69 document.getElementById("chart2"),
70 dst_data,
71 { width: 1024, labels: ['Date', 'Value'] }
72 );
0b4cf8f0
DV
73
74 g3 = new Dygraph(
75 document.getElementById("chart3"),
76"Date/Time,Purchases\n" +
77"2011-03-11 00:00:00,167082\n" +
78"2011-03-12 00:00:00,168571\n" +
79"2011-03-13 00:00:00,177796\n" +
80"2011-03-14 00:00:00,165587\n" +
81"2011-03-15 00:00:00,164380\n",
82 {
83 width: 1024,
84 dateWindow: [1299989043119.4365, 1300080693627.4866]
85 }
86 );
87
aaaf030e 88 var base_ms_spring = 1299997800000;
0b4cf8f0 89 var dst_data_spring = [];
aaaf030e 90 for (var x = base_ms_spring; x < base_ms_spring + 1000 * 60 * 120; x += 1000) {
0b4cf8f0
DV
91 dst_data_spring.push([new Date(x), x]);
92 }
93
94 g4 = new Dygraph(
95 document.getElementById("chart4"),
96 dst_data_spring,
97 { width: 1024, labels: ['Date', 'Value'] }
98 );
99
d1bce5a0
DV
100 </script>
101</body>
102</html>