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

Masayoshi Okutsu masayoshi.okutsu at oracle.com
Mon Feb 4 15:35:33 PST 2013


On 2/4/2013 11:33 PM, Stephen Colebourne wrote:
> On 4 February 2013 14:04, Masayoshi Okutsu <masayoshi.okutsu at oracle.com> wrote:
>
>> 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.

ofLocalizedDate() invokes 
DTFormatterBuilder().appendLocalized(dateStyle, null) which specifies 
the ISO Chronology as specified by appendLocalized. Then, the ISO 
Chronology is always used when looking up a pattern. withChronology 
doesn't change the Chronology. But neither ISO nor the given Chronology 
by withChronology should be used for actual formatting?

Looks like a structural problem in the API design rather than an 
implementation problem? Or am I just confused?

Thanks,
Masayoshi



More information about the threeten-dev mailing list