From 3ebee21ba6d49c449bf88c719cd356dab72e21c1 Mon Sep 17 00:00:00 2001 From: Brandon Stafford Date: Tue, 18 Dec 2012 20:52:05 +0000 Subject: [PATCH] Fix date axis rendering in jqPlot --- public/static/js/jqplot-plugins/jqplot.dateAxisRenderer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/static/js/jqplot-plugins/jqplot.dateAxisRenderer.js b/public/static/js/jqplot-plugins/jqplot.dateAxisRenderer.js index 0a210bf..3f13945 100644 --- a/public/static/js/jqplot-plugins/jqplot.dateAxisRenderer.js +++ b/public/static/js/jqplot-plugins/jqplot.dateAxisRenderer.js @@ -480,9 +480,11 @@ var tempti = ret[0]; this._autoFormatString = ret[1]; - min = Math.floor(min/tempti) * tempti; + // https://bitbucket.org/cleonello/jqplot/pull-request/24/added-suggested-fix-in-comment-8-for-issue/diff + // min = Math.floor(min/tempti) * tempti; min = new $.jsDate(min); - min = min.getTime() + min.getUtcOffset(); + min = Math.floor((min.getTime() - min.getUtcOffset())/tempti) * tempti + min.getUtcOffset(); + // min = min.getTime() + min.getUtcOffset(); nttarget = Math.ceil((max - min) / tempti) + 1; this.min = min; @@ -734,4 +736,3 @@ }; })(jQuery); -