From: Evert Timberg Date: Sat, 30 Jan 2016 22:19:32 +0000 (-0500) Subject: Minor fix X-Git-Tag: v2.0.0~58^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1950%2Fhead;p=thirdparty%2FChart.js.git Minor fix --- diff --git a/src/scales/scale.time.js b/src/scales/scale.time.js index 0dfab5216..b6fd864c0 100644 --- a/src/scales/scale.time.js +++ b/src/scales/scale.time.js @@ -217,8 +217,15 @@ // For every unit in between the first and last moment, create a moment and add it to the ticks tick for (var i = 1; i < this.tickRange; ++i) { + var newTick = roundedStart.clone().add(i, this.tickUnit); + + // Are we greater than the max time + if (this.options.time.max && newTick.diff(this.lastTick, this.tickUnit, true) >= 0) { + break; + } + if (i % this.unitScale === 0) { - this.ticks.push(roundedStart.clone().add(i, this.tickUnit)); + this.ticks.push(newTick); } }