]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Fix bugs in humanize and asYears
authorIskren Chernev <iskren.chernev@gmail.com>
Wed, 7 May 2014 16:18:54 +0000 (09:18 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Thu, 19 Jun 2014 05:32:16 +0000 (22:32 -0700)
moment.js

index 257efc0b8c233b95840ba97c9a8db77cad6143c6..8959f76bbeaf257d51d9d6b0ad325bf87e5a46be 100644 (file)
--- a/moment.js
+++ b/moment.js
                 years === 1 && ['y'] || ['yy', years];
 
         args[2] = withoutSuffix;
-        args[3] = +msOrDuration > 0;
+        args[3] = +posNegDuration > 0;
         args[4] = lang;
         return substituteTimeAgo.apply({}, args);
     }
     moment.duration.fn.asDays = function () { return this.as('d'); };
     moment.duration.fn.asWeeks = function () { return this.as('weeks'); };
     moment.duration.fn.asMonths = function () { return this.as('M'); };
-    moment.duration.fn.asYears = function () { return this.as('Y'); };
+    moment.duration.fn.asYears = function () { return this.as('y'); };
 
     /************************************
         Default Lang