From 002aa329110806d35c228a650f872bf06f3f2dbf Mon Sep 17 00:00:00 2001 From: Adam Vartanian Date: Wed, 11 Apr 2012 14:56:38 -0400 Subject: [PATCH] Always set milliseconds to zero when computing date tick placement, so that resulting times are exactly aligned and become dates when at 00:00. --- dygraph-tickers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dygraph-tickers.js b/dygraph-tickers.js index 41e60e4..b331de8 100644 --- a/dygraph-tickers.js +++ b/dygraph-tickers.js @@ -330,7 +330,7 @@ Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) { // Find a time less than start_time which occurs on a "nice" time boundary // for this granularity. var g = spacing / 1000; - var d = new Date(start_time); + var d = new Date(start_time).setMilliseconds(0); var x; if (g <= 60) { // seconds x = d.getSeconds(); d.setSeconds(x - x % g); -- 2.7.4