]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Minor fix 1950/head
authorEvert Timberg <evert.timberg@gmail.com>
Sat, 30 Jan 2016 22:19:32 +0000 (17:19 -0500)
committerEvert Timberg <evert.timberg@gmail.com>
Sat, 30 Jan 2016 22:19:32 +0000 (17:19 -0500)
src/scales/scale.time.js

index 0dfab52168a7e4289bddc60d9e3c6328e889d9f4..b6fd864c028bed6329ac89d3cfe07830f77e1d6a 100644 (file)
 
                        // 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);
                                }
                        }