You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking over a range of years 2000 to 2020, this happens only for 3 years:
var yr;
for (yr = 2000; yr < 2021; ++yr) {
var strIn = yr.toString() + '-W01';
var strOut = moment.utc(strIn).format('GGGG-[W]WW');
var same = (strIn == strOut);
if (!same) {
console.log(strIn + ' differs from formatted version ' + strOut);
}
}
produces:
2006-W01 differs from formatted version 2005-W52
2012-W01 differs from formatted version 2011-W52
2017-W01 differs from formatted version 2016-W52
The text was updated successfully, but these errors were encountered:
There appears to be a bug in ISO year-week parsing for some years: 2012 is an example:
This parses 1 week earlier than it should, and formats as follows:
but the correct string should be '2012-W01', same as input.
Here is the moment object:
Looking over a range of years 2000 to 2020, this happens only for 3 years:
produces:
The text was updated successfully, but these errors were encountered: