Closed jodastephen closed 11 years ago
First patch https://gist.github.com/jodastephen/5049319
On further examination, making this change would be really hard/complex and only benefit very limited use cases. Since most users will specify a concrete type as part of the parse (using ::from method reference) the chronology is already being applied. The withChronology
and withZone
methods on DateTimeFormatter
are therefore best left as defaults.
Javadoc clarification: http://hg.openjdk.java.net/threeten/threeten/jdk/rev/569031ace043
The use during formatting turned out to be incomplete and capable of improvement. In particular, some edge cases that would confuse users, such as expecting a YearMonth
to be converted to another calendar system, will now throw exceptions: http://hg.openjdk.java.net/threeten/threeten/jdk/rev/999f123d8687
Code was added to allow dates to be parsed in non-ISO chronologies. However, this doesn't fully take into account the chronology of the formatter as intended in the design.
There are two chronologies in use
Parse string "Minguo 1234-06-30" using a "formatter.withChronology(ThaiBuddhistChronology)" will parse the date using Minguo, and then convert the date to Thai before returning it.