[EXTERNAL] Re: 4-letter patterns in Date Format Style no longer give full text style
Bruno Borges
Bruno.Borges at microsoft.com
Mon Jul 10 19:49:48 UTC 2023
Given that "en_US" is well known and commonly a user input data, what is then the ideal way to create a Locale object for such string input?
And isn't this the case of a breaking change more than just updating the time database used by default in JDK?
Perhaps in other words, shouldn't Locale(String) constructor attempt to parse the input for the Locale(String, String) constructor so the behavior would have been maintained in accordance to Java 8?
Sent from mobile device.
________________________________
From: Naoto Sato <naoto.sato at oracle.com>
Sent: Monday, July 10, 2023 12:36:10 PM
To: Bruno Borges <Bruno.Borges at microsoft.com>; core-libs-dev at openjdk.org <core-libs-dev at openjdk.org>
Subject: [EXTERNAL] Re: 4-letter patterns in Date Format Style no longer give full text style
Hi,
In your test case,
```
new Locale("en_US");
```
This will fall back to ROOT locale texts with CLDR (default since JDK9)
where it differs from US English. Probably you may want to `new
Locale("en", "US)` or preferably use `Locale.US` constant.
Naoto
On 7/10/23 12:08 PM, Bruno Borges wrote:
> Hi all,
>
> Was there any change to Date Time Formatter API that made the "EEEE" and
> the "MMMM" (and other 4-letter patterns) change from Java 8 to 11+ ?
>
> In Java 8, "EEEE" with locale en_US correctly gives the FULL day of
> week, e.g., "Monday".
>
> In Java 11 and 17 (two I've tested), the same input will give "Mon".
>
> I've also tested for "MMMM" expecting "July" (as in 8), but in 11/17 I
> get only "Jul".
>
> Here's a test case:
>
> brunoborges/date-formatting-bug at f8f84a1 (github.com)
> <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbrunoborges%2Fdate-formatting-bug%2Factions%2Fruns%2F5511890139%2Fjobs%2F10048031299&data=05%7C01%7CBruno.Borges%40microsoft.com%7C742add55ab3045a3ba2f08db817ced57%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638246145792123639%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Pgkr6uURQFaOjO3GL2stbpWprIgKFJTHBkBvu5ZZFNY%3D&reserved=0<https://github.com/brunoborges/date-formatting-bug/actions/runs/5511890139/jobs/10048031299>>
>
>
> Thanks,
> Bruno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20230710/6b825ef3/attachment-0001.htm>
More information about the core-libs-dev
mailing list