From: Afanasii Kurakin Date: Tue, 1 Mar 2016 05:13:43 +0000 (+0800) Subject: Using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors X-Git-Tag: 2.13.0~17^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cdad3ff60ec1a6a205012df95fbd7c2185c0956;p=thirdparty%2Fmoment.git Using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors --- diff --git a/src/lib/duration/constructor.js b/src/lib/duration/constructor.js index 884c6f8c8..fb01c7041 100644 --- a/src/lib/duration/constructor.js +++ b/src/lib/duration/constructor.js @@ -17,7 +17,7 @@ export function Duration (duration) { this._milliseconds = +milliseconds + seconds * 1e3 + // 1000 minutes * 6e4 + // 1000 * 60 - hours * 36e5; // 1000 * 60 * 60 + hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 // Because of dateAddRemove treats 24 hours as different from a // day when working around DST, we need to store them separately this._days = +days +