[Webkit-unassigned] [Bug 231545] New: REGRESSION (iOS 15): Intl.DateTimeFormat returns 2 digit years when year is 'numeric' and month is '2-digit' and day is '2-digit'
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Oct 11 17:00:19 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=231545
Bug ID: 231545
Summary: REGRESSION (iOS 15): Intl.DateTimeFormat returns 2
digit years when year is 'numeric' and month is
'2-digit' and day is '2-digit'
Product: WebKit
Version: Other
Hardware: iPhone / iPad
OS: Other
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
Assignee: webkit-unassigned at lists.webkit.org
Reporter: matt.carroll139 at gmail.com
This test case passes:
```
const dtf = new Intl.DateTimeFormat('en-AU', { timeZone: 'Australia/Melbourne', year: 'numeric' });
const date = new Date(2021, 9, 2);
const parts = dtf.formatToParts(date);
const year = parts.find(part => part.type === 'year')
shouldBe(year.value, "2021")
```
This test case will fail:
```
const dtf = new Intl.DateTimeFormat('en-AU', { timeZone: 'Australia/Melbourne', year: 'numeric', month: '2-digit', day: '2-digit' });
const date = new Date(2021, 9, 2);
const parts = dtf.formatToParts(date);
const year = parts.find(part => part.type === 'year')
shouldBe(year.value, "2021") // actual is "21"
```
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211012/868aeff7/attachment-0001.htm>
More information about the webkit-unassigned
mailing list