From 172c088c6b75d8fe45939029fe9d8f6a3884c6db Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Sat, 30 Jan 2016 17:19:32 -0500 Subject: [PATCH] Minor fix --- src/scales/scale.time.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); } } -- 2.47.2