From: Dan Vanderkam <danvdk@gmail.com> Date: Mon, 18 Feb 2013 05:02:49 +0000 (-0500) Subject: One more case in which ticks across DST boundaries are still broken X-Git-Tag: v1.0.0~63 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=0b4cf8f0eefb5c3c8592843474843d57cc0494f2;p=dygraphs.git One more case in which ticks across DST boundaries are still broken --- diff --git a/tests/daylight-savings.html b/tests/daylight-savings.html index 4e9e4c0..0e28162 100644 --- a/tests/daylight-savings.html +++ b/tests/daylight-savings.html @@ -12,6 +12,12 @@ --> <script type="text/javascript" src="../dygraph-dev.js"></script> + <style> + body { + max-width: 1024px; + } + </style> + </head> <body> <h2>DST</h2> @@ -27,6 +33,14 @@ <div id="chart2"></div> <p>This chart shows a continuous line going across the "fall back" EST/EDT event. You may need to switch your computer's time zone to Eastern to see this. The x-axis tick marks go from 01:00 → 01:55 and then back to 01:00.</p> + <hr/> + <div id="chart3"></div> + <p>This chart is analogous to the first, except at a "spring forward".</p> + + <hr/> + <div id="chart4"></div> + <p>This chart shows a continuous series which crosses a "spring forward". The x-axis ticks should skip from 1:55AM to 3:00AM.</p> + <script type="text/javascript"> g = new Dygraph( document.getElementById("demodiv"), @@ -48,11 +62,38 @@ dst_data.push([new Date(x), x]); } - g = new Dygraph( + g2 = new Dygraph( document.getElementById("chart2"), dst_data, { width: 1024, labels: ['Date', 'Value'] } ); + + g3 = new Dygraph( + document.getElementById("chart3"), +"Date/Time,Purchases\n" + +"2011-03-11 00:00:00,167082\n" + +"2011-03-12 00:00:00,168571\n" + +"2011-03-13 00:00:00,177796\n" + +"2011-03-14 00:00:00,165587\n" + +"2011-03-15 00:00:00,164380\n", + { + width: 1024, + dateWindow: [1299989043119.4365, 1300080693627.4866] + } + ); + + var base_ms_spring = 1299999000000; + var dst_data_spring = []; + for (var x = base_ms_spring; x < base_ms_spring + 1000 * 60 * 80; x += 1000) { + dst_data_spring.push([new Date(x), x]); + } + + g4 = new Dygraph( + document.getElementById("chart4"), + dst_data_spring, + { width: 1024, labels: ['Date', 'Value'] } + ); + </script> </body> </html>