Skip to content
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

Merged
merged 3 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions files/en-us/mozilla/firefox/releases/122/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ This article provides information about the changes in Firefox 122 that affect d

- The {{jsxref("ArrayBuffer.prototype.transfer()")}} and {{jsxref("ArrayBuffer.prototype.transferToFixedLength()")}} methods can now be used to [transfer ownership](/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer#transferring_arraybuffers) of memory from one {{jsxref("ArrayBuffer")}} to another. After transfer, the original buffer is detached from its original memory and hence unusable; the state can be checked using {{jsxref("ArrayBuffer.prototype.detached")}}. (See [Firefox bug 1865103](https://bugzil.la/1865103) for more details.)

- For parity with other browsers, [`Date.parse()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse) and the [`Date()` constructor](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date) only consider the first three letters of the specified month when [non-standard date strings](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#non-standard_date_strings) are parsed. Previously only truncated values of the full month name with three or more characters were accepted (See [Firefox bug 1862910](https://bugzil.la/1862910) for more details.)

### SVG

#### Removals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Member

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.

// Chrome, Safari, and Firefox 122 and later parse only the first three letters for the month.
// FF121 and earlier parse first three letters and any substring up to the correct month name.
Date.parse("04 Dec 1995"); // Valid all implementations
hamishwillee marked this conversation as resolved.
Show resolved Hide resolved
Date.parse("04 Decem 1995"); // Valid all implementations
Date.parse("04 December 1995"); // Valid all implementations
Date.parse("04 DecFoo 1995"); // NaN in Firefox 121 and earlier. Valid otherwise.
Date.parse("04 De 1995"); // NaN in all implementations
hamishwillee marked this conversation as resolved.
Show resolved Hide resolved
```

## Specifications
Expand Down
Loading