]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
fixing a possible bug with the current week year, and also a touch of cleanup
authorIsaac Cambron <isaac@isaaccambron.com>
Fri, 4 Oct 2013 09:19:34 +0000 (05:19 -0400)
committerIsaac Cambron <isaac@isaaccambron.com>
Fri, 4 Oct 2013 09:19:34 +0000 (05:19 -0400)
moment.js

index 3857ada680ce0bd8a913e7ad5a37073d32bc1697..76ca480caa06ab2d2fc13571cc0f7449046e9093 100644 (file)
--- a/moment.js
+++ b/moment.js
                 return val ?
                   (val.length < 3 ? (parseInt(val, 10) > 68 ? '19' + val : '20' + val) : val) :
                   (config._a[YEAR] != null ? currentDate[YEAR] :
-                    (config._a[YEAR] == null ? currentDate[YEAR] : config._a[YEAR]));
+                    (config._a[YEAR] == null ? moment().weekYear() : config._a[YEAR]));
             };
 
             w = config._w;
         if (moment.isMoment(input)) {
             config = extend({}, input);
 
-            //null this out to prevent infinite loops
-            config._w = null;
-
             config._d = new Date(+input._d);
         } else if (format) {
             if (isArray(format)) {