-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
FF122 Date parser parses first three chars of month #31931
Conversation
Preview URLs
External URLs (1)URL:
(comment last updated: 2024-02-09 00:05:19) |
files/en-us/web/javascript/reference/global_objects/date/parse/index.md
Outdated
Show resolved
Hide resolved
@@ -94,6 +94,14 @@ Date.parse("2014-02-30"); | |||
// NaN in Safari and Firefox; | |||
// 1393718400000 in Chrome (Sun Mar 02 2014 00:00:00 GMT+0000) | |||
Date.parse("02/30/2014"); // 1393718400000 in all implementations | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope of this PR, but I think this section is getting a little disorganized. Maybe in future we can separate this code block into categories or subsections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Hamish! Some comments for consideration, but leaving a +1 👍🏻
This pull request has merge conflicts that must be resolved before it can be merged. |
files/en-us/web/javascript/reference/global_objects/date/parse/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Brian Thomas Smith <[email protected]>
Thanks for the review @bsmth - much appreciated. |
For parity with Chrome/Safari the data parsers now only looks at the first three characters of the month when parsing non-standard date strings. Previously it would parse only valid truncated values of the month name - e.g. for december it might accept Dec, Dece, Decemb, December. Now it will accept DecFooo like the other browsers.
This adds a release note and an example in the
Date.parse()
function.Related docs work can be tracked in #31930