<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>230827</bug_id>
          
          <creation_ts>2021-09-27 05:22:11 -0700</creation_ts>
          <short_desc>REGRESSION (iOS 15): Intl.DateTimeFormat returns 2 digit years when type is &apos;numeric&apos;</short_desc>
          <delta_ts>2021-11-23 12:33:22 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>Other</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=231545</see_also>
          <bug_file_loc>https://jsfiddle.net/davidwebster/0b6qfu34/5/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Webster">davidcwebster</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>blake</cc>
    
    <cc>davidcwebster</cc>
    
    <cc>kevin_neal</cc>
    
    <cc>kontakt</cc>
    
    <cc>matt.carroll139</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1797432</commentid>
    <comment_count>0</comment_count>
    <who name="David Webster">davidcwebster</who>
    <bug_when>2021-09-27 05:22:11 -0700</bug_when>
    <thetext>This bug occurs in Safari on iOS 15.

When Intl.DateTimeFormat is formatting a year, and the configuration for year is &apos;numeric&apos;, it returns a two-digit year. However, I expect the full year. Previous versions returned the full year, and other browsers (including Safari 15 on OSX) return the full year.

Here&apos;s a code sample:

const dtf = new Intl.DateTimeFormat(&apos;en-AU&apos;, { timeZone: &apos;Australia/Melbourne&apos;, year: &apos;numeric&apos; });
const date = new Date();
const parts = dtf.formatToParts(date);
const year = parts.find(part =&gt; part.type === &apos;year&apos;)
console.log(year.value)
// expected output is &quot;2021&quot;, but in Safari 15 on iOS, it&apos;s &quot;21&quot;.

You can try this at https://jsfiddle.net/davidwebster/0b6qfu34/5/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1798365</commentid>
    <comment_count>1</comment_count>
    <who name="Kevin Neal">kevin_neal</who>
    <bug_when>2021-09-29 09:10:49 -0700</bug_when>
    <thetext>Thank you for filing. What version of iOS 15 are you using? I was not able to reproduce the bug using the latest iOS 15 beta.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1798366</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-09-29 09:10:57 -0700</bug_when>
    <thetext>&lt;rdar://problem/83673541&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1798707</commentid>
    <comment_count>3</comment_count>
    <who name="David Webster">davidcwebster</who>
    <bug_when>2021-09-29 17:42:35 -0700</bug_when>
    <thetext>I&apos;m using version 15.0.

I&apos;m using the Simulator in XCode because I don&apos;t have a real iPhone to test on. I can&apos;t find any way to use the latest iOS 15 beta in the simulator.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1799766</commentid>
    <comment_count>4</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2021-10-02 14:10:40 -0700</bug_when>
    <thetext>Thank you for filing an issue!
I tried it in iOS 15 device and iOS 15 simulator, but I cannot reproduce this issue.
Both shows the &quot;2021&quot;, expected behavior.

For now, I&apos;ll just add that as a regression test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1799767</commentid>
    <comment_count>5</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2021-10-02 14:24:39 -0700</bug_when>
    <thetext>Committed r283446 (242433@main): &lt;https://commits.webkit.org/242433@main&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1799768</commentid>
    <comment_count>6</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2021-10-02 14:25:24 -0700</bug_when>
    <thetext>Since we cannot reproduce this issue, we didn&apos;t change the code, but adding a test case to our stress tests to ensure that this is/will be happening. Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1801828</commentid>
    <comment_count>7</comment_count>
    <who name="Matt Carroll">matt.carroll139</who>
    <bug_when>2021-10-07 15:28:19 -0700</bug_when>
    <thetext>Can this please be reopened. It seems the bug still exists.

This test case passes:

```
const dtf = new Intl.DateTimeFormat(&apos;en-AU&apos;, { timeZone: &apos;Australia/Melbourne&apos;, year: &apos;numeric&apos; });
const date = new Date(2021, 9, 2);
const parts = dtf.formatToParts(date);
const year = parts.find(part =&gt; part.type === &apos;year&apos;)
shouldBe(year.value, &quot;2021&quot;)
```


This test case will fail:

```
const dtf = new Intl.DateTimeFormat(&apos;en-AU&apos;, { timeZone: &apos;Australia/Melbourne&apos;, year: &apos;numeric&apos;, month: &apos;2-digit&apos;, day: &apos;2-digit&apos; });
const date = new Date(2021, 9, 2);
const parts = dtf.formatToParts(date);
const year = parts.find(part =&gt; part.type === &apos;year&apos;)
shouldBe(year.value, &quot;2021&quot;) // actual is &quot;21&quot;
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803302</commentid>
    <comment_count>8</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2021-10-12 12:21:42 -0700</bug_when>
    <thetext>(In reply to Matt Carroll from comment #7)
&gt; Can this please be reopened. It seems the bug still exists.
&gt; 
&gt; This test case passes:
&gt; 
&gt; ```
&gt; const dtf = new Intl.DateTimeFormat(&apos;en-AU&apos;, { timeZone:
&gt; &apos;Australia/Melbourne&apos;, year: &apos;numeric&apos; });
&gt; const date = new Date(2021, 9, 2);
&gt; const parts = dtf.formatToParts(date);
&gt; const year = parts.find(part =&gt; part.type === &apos;year&apos;)
&gt; shouldBe(year.value, &quot;2021&quot;)
&gt; ```
&gt; 
&gt; 
&gt; This test case will fail:
&gt; 
&gt; ```
&gt; const dtf = new Intl.DateTimeFormat(&apos;en-AU&apos;, { timeZone:
&gt; &apos;Australia/Melbourne&apos;, year: &apos;numeric&apos;, month: &apos;2-digit&apos;, day: &apos;2-digit&apos; });
&gt; const date = new Date(2021, 9, 2);
&gt; const parts = dtf.formatToParts(date);
&gt; const year = parts.find(part =&gt; part.type === &apos;year&apos;)
&gt; shouldBe(year.value, &quot;2021&quot;) // actual is &quot;21&quot;
&gt; ```

Thanks. The updated test case can reproduce the issue.
This looks like a data problem in AppleICU (not WebKit), and now tracked by AppleICU team at rdar://83597941.
So closing this issue since the issue is in system ICU, not in WebKit code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803389</commentid>
    <comment_count>9</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2021-10-12 14:28:31 -0700</bug_when>
    <thetext>*** Bug 231545 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803415</commentid>
    <comment_count>10</comment_count>
    <who name="Matt Carroll">matt.carroll139</who>
    <bug_when>2021-10-12 14:52:27 -0700</bug_when>
    <thetext>Is there an ETA on when this will be fixed in iOS?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803417</commentid>
    <comment_count>11</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2021-10-12 14:53:39 -0700</bug_when>
    <thetext>(In reply to Matt Carroll from comment #10)
&gt; Is there an ETA on when this will be fixed in iOS?

Apple does not comment on future products or releases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1803420</commentid>
    <comment_count>12</comment_count>
    <who name="Matt Carroll">matt.carroll139</who>
    <bug_when>2021-10-12 14:54:20 -0700</bug_when>
    <thetext>Ok, thank you.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1809516</commentid>
    <comment_count>13</comment_count>
    <who name="Blake">blake</who>
    <bug_when>2021-10-27 17:57:40 -0700</bug_when>
    <thetext>Has there been any update on this, we are still experiencing the issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1813827</commentid>
    <comment_count>14</comment_count>
    <who name="Blake">blake</who>
    <bug_when>2021-11-10 15:56:59 -0800</bug_when>
    <thetext>Hi, this bug has been marked as resolved but we can see the error is still occurring. Is this being investigated further?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1817504</commentid>
    <comment_count>15</comment_count>
    <who name="Wojciech Maj">kontakt</who>
    <bug_when>2021-11-23 12:33:22 -0800</bug_when>
    <thetext>I was also able to reproduce this bug on Safari 15.1 (17612.2.9.1.20) on macOS Monterey. So this is NOT exclusive to iOS.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>