[threeten-dev] Clarification request: DateTimeFormatter.ofLocalizedDate/Time behavior

Stephen Colebourne scolebourne at joda.org
Mon Feb 4 06:33:56 PST 2013


On 4 February 2013 14:04, Masayoshi Okutsu <masayoshi.okutsu at oracle.com> wrote:
>> Ideally, DateTimeFormatStyleProvider should be reworked entirely to
>> access the CLDR data more directly.
> That's what I'm trying to do.
Cool :-)

> So is the intention to evaluate the Chronology from chronoDate and the
> Locale from a DateTimeFormatter on every format() call? If so,
> DateTimeFormatterbuilder needs some changes. Currently, the Chronology is
> taken from a DateTimeFormatter, which is always ISO.

If a JapaneseDate object is passed in to be formatted, then the
chronology of that date (Japanese) should be being passed to the style
provider. If its not, then it may be a bug.

>> JapaneseDate + locale jp_JP => locale jp_JP-u-ca-japanese
>>
>> However, you raise an interesting question of what if the locale
>> includes a "ca" block already. The simple case is:
>>   JapaneseDate + locale jp_JP-japanese => locale jp_JP-u-ca-japanese
>>
>> the complex cases are:
>>   JapaneseDate + locale jp_JP-minguo => ?
>>   MinguoDate + locale jp_JP-japanese => ?
>
> I think any calendar type given by a Locale should be ignored in
> DateTimeFormat. Otherwise, it'd be too confusing.

Sounds sensible.
Stephen


More information about the threeten-dev mailing list