From: Joan Pau Beltran Date: Thu, 5 Jun 2014 15:46:27 +0000 (+0200) Subject: Format year of monthly tick lables with 2 digits instead of 4. X-Git-Tag: v1.1.0~31^2~16 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=78c0594725dbd1c71220f3f8b6d4ec905baec16f;p=dygraphs.git 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`. --- 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;