From: Isaac Cambron Date: Fri, 4 Oct 2013 09:19:34 +0000 (-0400) Subject: fixing a possible bug with the current week year, and also a touch of cleanup X-Git-Tag: 2.3.0~1^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9b77ca3c07ef4cf98530b4d491da234bfd9ffd6;p=thirdparty%2Fmoment.git fixing a possible bug with the current week year, and also a touch of cleanup --- diff --git a/moment.js b/moment.js index 3857ada68..76ca480ca 100644 --- a/moment.js +++ b/moment.js @@ -1093,7 +1093,7 @@ 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; @@ -1477,9 +1477,6 @@ 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)) {