-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Weird parsing behavior for invalid dates with years before 1970 #2645
Comments
Closed in favor of #2646 |
@elreimundo what is If we ever want to make |
@ichernev 1) it doesn't matter whether you agree with the validity of My fix does not make Also, what grounds do you have for calling "hacky" a legitimate check for |
@elreimundo well, in your PR you mentioned that one date was valid and the other wasn't, and you made them both invalid (but I did't pay attention and thought they were both made valid). That is why I said "hack", because I though it "fixes" something that is not supposed to work. I agree -- the behavior of the two should not be different. We changed the code in the last (unreleased) version to only But then -- why don't we check if the Date object is valid, not if its year is finite. There can not be an infinite year in a valid date. |
Fixed in #2646 |
The second date is just as invalid as the first date. This appears to be a direct result of the pre-1970 workaround in
https://github.com/moment/moment/blob/develop/src/lib/create/date-from-array.js
.The text was updated successfully, but these errors were encountered: