| 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 | Reporter: | Matt Carroll <matt.carroll139> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | ysuzuki |
| Priority: | P2 | ||
| Version: | Other | ||
| Hardware: | iPhone / iPad | ||
| OS: | Other | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=230827 | ||
Thanks! This is dupe of bug 230827. *** This bug has been marked as a duplicate of bug 230827 *** |
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" ```