Bug 231545 - REGRESSION (iOS 15): Intl.DateTimeFormat returns 2 digit years when year is 'numeric' and month is '2-digit' and day is '2-digit'
Summary: REGRESSION (iOS 15): Intl.DateTimeFormat returns 2 digit years when year is '...
Status: RESOLVED DUPLICATE of bug 230827
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: iPhone / iPad Other
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-11 17:00 PDT by Matt Carroll
Modified: 2021-10-12 14:28 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Carroll 2021-10-11 17:00:19 PDT
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"
```
Comment 1 Yusuke Suzuki 2021-10-12 14:28:31 PDT
Thanks! This is dupe of bug 230827.

*** This bug has been marked as a duplicate of bug 230827 ***