From 78c0594725dbd1c71220f3f8b6d4ec905baec16f Mon Sep 17 00:00:00 2001 From: Joan Pau Beltran Date: Thu, 5 Jun 2014 17:46:27 +0200 Subject: [PATCH] Format year of monthly tick lables with 2 digits instead of 4. Since commit 7b2dfd0 (Oct 15, 2013) the format of monthly tick labels is `%b %Y` (e.g. Oct 2013). Before the format was '%b %y' (e.g. Oct 13). Revert to the later format because it seems to be an accidental change. * `dygraph.js`: Revert format of monthly tick labels from `%b %Y` to `%b %y`. --- dygraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dygraph.js b/dygraph.js index e1b78bd..87a7dab 100644 --- a/dygraph.js +++ b/dygraph.js @@ -233,7 +233,7 @@ Dygraph.dateAxisLabelFormatter = function(date, granularity, opts) { if (granularity >= Dygraph.DECADAL) { return '' + year; } else if (granularity >= Dygraph.MONTHLY) { - return Dygraph.SHORT_MONTH_NAMES_[month] + ' ' + year; + return Dygraph.SHORT_MONTH_NAMES_[month] + ' ' + Dygraph.zeropad(year % 100); } else { // 1e-3 factor on millis missing in original implementation var frac = hours * 3600 + mins * 60 + secs + 1e-3 * millis; -- 2.7.4