]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Round yearsToDays output to a whole number.
authorJohn Madhavan-Reese <jsmreese@pureshare.com>
Fri, 12 Sep 2014 21:00:07 +0000 (17:00 -0400)
committerIskren Chernev <iskren.chernev@gmail.com>
Mon, 17 Nov 2014 07:31:04 +0000 (23:31 -0800)
moment.js

index d10b688bd98753e44986c2808ed907fea6addd78..595a01e1c34e687c3d795bb3367d08ca310eb656 100644 (file)
--- a/moment.js
+++ b/moment.js
                 return units === 'month' ? months : months / 12;
             } else {
                 // handle milliseconds separately because of floating point math errors (issue #1867)
-                days = this._days + yearsToDays(this._months / 12);
+                days = this._days + Math.floor(yearsToDays(this._months / 12));
                 switch (units) {
                     case 'week': return days / 7 + this._milliseconds / 6048e5;
                     case 'day': return days + this._milliseconds / 864e5;