From: John Madhavan-Reese Date: Mon, 25 Aug 2014 16:28:21 +0000 (-0400) Subject: Whitespace X-Git-Tag: 2.8.3~8^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a7a5fb56a81be69f7d857f08322283354e4948f;p=thirdparty%2Fmoment.git Whitespace --- diff --git a/moment.js b/moment.js index 5f7054135..0c19f59df 100644 --- a/moment.js +++ b/moment.js @@ -2694,8 +2694,8 @@ days = this._days + this._milliseconds / 864e5; months = this._months + daysToYears(days) * 12; return units === 'month' ? months : months / 12; - } else { - // handle milliseconds separately because of floating point math errors (issue #1867) + } else { + // handle milliseconds separately because of floating point math errors (issue #1867) days = this._days + yearsToDays(this._months / 12); switch (units) { case 'week': return days / 7 + this._milliseconds / 6048e5; @@ -2703,7 +2703,7 @@ case 'hour': return days * 24 + this._milliseconds / 36e5; case 'minute': return days * 24 * 60 + this._milliseconds / 6e4; case 'second': return days * 24 * 60 * 60 + this._milliseconds / 1000; - // Math.floor prevents floating point math errors here + // Math.floor prevents floating point math errors here case 'millisecond': return Math.floor(days * 24 * 60 * 60 * 1000) + this._milliseconds; default: throw new Error('Unknown unit ' + units); } diff --git a/test/moment/duration.js b/test/moment/duration.js index 42e569900..c8fd96241 100644 --- a/test/moment/duration.js +++ b/test/moment/duration.js @@ -513,7 +513,7 @@ exports.duration = { test.done(); }, - 'as getters for small units' : function (test) { + 'as getters for small units' : function (test) { var dS = moment.duration(1, 'milliseconds'), ds = moment.duration(3, 'seconds'), dm = moment.duration(13, 'minutes'); @@ -529,7 +529,7 @@ exports.duration = { test.equal(dm.asMinutes(), 13, 'asMinutes()'); test.done(); }, - + 'isDuration' : function (test) { test.expect(3); test.ok(moment.isDuration(moment.duration(12345678)), 'correctly says true');