-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong year calculation for ISO Dates before 1970 #1627
Comments
some additional details: moment('1969-01-01T00:00:00.000+01:00').year() moment('1969-01-01T00:00:00.000').year() So the problem only exists when the timezone is the same as the actual browser timezone it seems. |
Are you on safari? Also what is your location (timezone, language). |
Ahh, you're right. This is happening because of a weird interplay between Date bug workaround (manually set the year if I guess we need to rethink the way timezones are parsed. First parse, then verify, then apply offset. |
sounds reasonable 👍 |
The pr would fix it in next release dont worry. Thank you for reporting |
When I try to parse ISO Dates before 1970 the year caluclation is wrong. It will add one year.
Which results in following very strange result:
moment('1970-01-01T00:00:00.000+01:00').isSame(moment('1969-01-01T00:00:00.000+01:00')) === true
used moment.version
"2.6.0"
The text was updated successfully, but these errors were encountered: