]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Refactored firstTick null check
authorTore Lervik <tore@lervik.com>
Mon, 21 Dec 2015 21:40:33 +0000 (22:40 +0100)
committerTore Lervik <tore@lervik.com>
Mon, 21 Dec 2015 21:40:33 +0000 (22:40 +0100)
src/scales/scale.time.js

index 6d17e5ee5c21fbf1a2b547d6ea2db34012269189..971f58e02cfe0f9bd31eb833da4ece3dcfd98bc1 100644 (file)
                        }, this);
 
                        // We will modify these, so clone for later
-                       if (this.firstTick != null)
-                this.firstTick = this.firstTick.clone();
-            else
-                this.firstTick = moment(new Date);
-
-            if (this.lastTick != null)
-                this.lastTick = this.lastTick.clone();
-            else
-                this.lastTick = moment(new Date);
+                       this.firstTick = (this.firstTick || moment(new Date)).clone();
+                       this.lastTick = (this.lastTick || moment(new Date)).clone();
                },
                buildTicks: function(index) {