From: Nicholas Bollweg Date: Thu, 15 Aug 2013 17:58:41 +0000 (-0400) Subject: linting... really should add precommit hook X-Git-Tag: 2.3.0~10^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90653380ea104fbcb401b51e2f2f9af359fc86ba;p=thirdparty%2Fmoment.git linting... really should add precommit hook --- diff --git a/moment.js b/moment.js index 39b7fbd8d..86e0b64cb 100644 --- a/moment.js +++ b/moment.js @@ -1649,10 +1649,10 @@ 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 ? '-' : '') + diff --git a/test/moment/duration.js b/test/moment/duration.js index cbf7e56f5..8362466c7 100644 --- a/test/moment/duration.js +++ b/test/moment/duration.js @@ -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");