From: Tanner Linsley Date: Tue, 20 Oct 2015 03:23:01 +0000 (-0600) Subject: Support min and max dates on time scale X-Git-Tag: 2.0.0-beta~4^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35011e5ae396d5dd68961d14ec50d8ef5f3a809e;p=thirdparty%2FChart.js.git Support min and max dates on time scale --- diff --git a/src/scales/scale.time.js b/src/scales/scale.time.js index ad1365dda..88af1436b 100644 --- a/src/scales/scale.time.js +++ b/src/scales/scale.time.js @@ -91,8 +91,17 @@ scaleLabelMoments.push(labelMoment); }, this); - this.firstTick = moment.min.call(this, scaleLabelMoments); - this.lastTick = moment.max.call(this, scaleLabelMoments); + if (this.options.time.min) { + this.firstTick = this.parseTime(this.options.time.min); + } else { + this.firstTick = moment.min.call(this, scaleLabelMoments); + } + + if (this.options.time.max) { + this.lastTick = this.parseTime(this.options.time.max); + } else { + this.lastTick = moment.max.call(this, scaleLabelMoments); + } } else { this.firstTick = null; this.lastTick = null;