Skip to content

Commit 2f8d504

Browse files
hamishwilleepepelsbeybsmth
authored
FF122 Date parser parses first three chars of month (#31931)
* FF122 Date parser parses first three chars of month * Apply suggestions from code review Co-authored-by: Brian Thomas Smith <[email protected]> --------- Co-authored-by: Vadim Makeev <[email protected]> Co-authored-by: Brian Thomas Smith <[email protected]>
1 parent 6ede34c commit 2f8d504

File tree

2 files changed

+10
-0
lines changed
  • files/en-us
    • mozilla/firefox/releases/122
    • web/javascript/reference/global_objects/date/parse

2 files changed

+10
-0
lines changed

files/en-us/mozilla/firefox/releases/122/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ This article provides information about the changes in Firefox 122 that affect d
2929

3030
- 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.)
3131

32+
- 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.)
33+
3234
### SVG
3335

3436
#### Removals

files/en-us/web/javascript/reference/global_objects/date/parse/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ Date.parse("2014-02-30");
9494
// NaN in Safari and Firefox;
9595
// 1393718400000 in Chrome (Sun Mar 02 2014 00:00:00 GMT+0000)
9696
Date.parse("02/30/2014"); // 1393718400000 in all implementations
97+
98+
// Chrome, Safari, and Firefox 122 and later parse only the first three letters for the month.
99+
// FF121 and earlier parse first three letters and any substring up to the correct month name.
100+
Date.parse("04 Dec 1995"); // 818031600000 in all implementations
101+
Date.parse("04 Decem 1995"); // 818031600000 in all implementations
102+
Date.parse("04 December 1995"); // 818031600000 in all implementations
103+
Date.parse("04 DecFoo 1995"); // NaN in Firefox 121 and earlier. 818031600000 in other implementations
104+
Date.parse("04 De 1995"); // NaN in all implementations
97105
```
98106

99107
## Specifications

0 commit comments

Comments
 (0)