ThreeTen / threetenbp

Backport of functionality based on JSR-310 to Java SE 6 and 7. This is NOT an implementation of JSR-310.
http://www.threeten.org/threetenbp/
BSD 3-Clause "New" or "Revised" License
552 stars 139 forks source link

DateTimeFormatter doesn't follow locale when using QQQQ pattern #167

Open xatok opened 1 year ago

xatok commented 1 year ago

This code using 1.6.1 version of threetenbp:

 org.threeten.bp.LocalDate
        .of(2020, 1, 1)
        .format(org.threeten.bp.format.DateTimeFormatter.ofPattern("QQQQ", Locale.FRANCE))

outputs: 1st quarter

And then the same code using Java 11 implementation it outputs the correct format:

    java.time.LocalDate
        .of(2020, 1, 1)
        .format(java.time.format.DateTimeFormatter.ofPattern("QQQQ", Locale.FRANCE))

outputs: 1er trimestre

The outputs should be also localized with threetenbp.

jodastephen commented 1 year ago

Threeten-Backport doe not have a general purpose mechanism for supplying text like this, it would be a big job to do so. Later JDKs simply have more data built in.