]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
linting... really should add precommit hook
authorNicholas Bollweg <nicholas.bollweg@gtri.gatech.edu>
Thu, 15 Aug 2013 17:58:41 +0000 (13:58 -0400)
committerNicholas Bollweg <nicholas.bollweg@gtri.gatech.edu>
Thu, 15 Aug 2013 17:58:41 +0000 (13:58 -0400)
moment.js
test/moment/duration.js

index 39b7fbd8dcda145d14e0e893d0c648ed4a4c9f9f..86e0b64cb933a5e9f0609b441a2f74a3323c2748 100644 (file)
--- a/moment.js
+++ b/moment.js
                 minutes = Math.abs(this.minutes()),
                 seconds = Math.abs(this.seconds() + this.milliseconds() / 1000);
 
-            if(!this.asSeconds()){
-              // this is the same as C#'s (Noda) and python (isodate)... 
-              // but not other JS (goog.date)
-              return 'PT0D';
+            if (!this.asSeconds()) {
+                // this is the same as C#'s (Noda) and python (isodate)... 
+                // but not other JS (goog.date)
+                return 'PT0D';
             }
 
             return (this.asSeconds() < 0 ? '-' : '') +
index cbf7e56f5c05a70ed07c9b583abdaa42d82d3b52..8362466c723724a6af33660b16ea4f740399d465 100644 (file)
@@ -231,7 +231,7 @@ exports.duration = {
         test.equal(moment.duration("PT1M").asSeconds(), moment.duration({m: 1}).asSeconds(), "python isodate 7");
         test.equal(moment.duration("P0.5Y").asSeconds(), moment.duration({y: 0.5}).asSeconds(), "python isodate 8");
         test.equal(moment.duration("PT36H").asSeconds(), moment.duration({h: 36}).asSeconds(), "python isodate 9");
-        test.equal(moment.duration("P1DT12H").asSeconds(), moment.duration({d: 1, h:12}).asSeconds(), "python isodate 10");
+        test.equal(moment.duration("P1DT12H").asSeconds(), moment.duration({d: 1, h: 12}).asSeconds(), "python isodate 10");
         test.equal(moment.duration("-P2W").asSeconds(), moment.duration({w: -2}).asSeconds(), "python isodate 11");
         test.equal(moment.duration("-P2.2W").asSeconds(), moment.duration({w: -2.2}).asSeconds(), "python isodate 12");
         test.equal(moment.duration("P1DT2H3M4S").asSeconds(), moment.duration({d: 1, h: 2, m: 3, s: 4}).asSeconds(), "python isodate 13");
@@ -249,7 +249,7 @@ exports.duration = {
         test.done();
     },
     
-    "ISO 8601 misuse cases" : function(test){
+    "ISO 8601 misuse cases" : function (test) {
         test.expect(9);
         test.equal(moment.duration("P").asSeconds(), 0, "lonely P");
         test.equal(moment.duration("PT").asSeconds(), 0, "just P and T");