Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8084654 | emb-9 | Xueming Shen | P3 | Resolved | Fixed | team |
protected final DateTimeFormatter CHRONO_FORMAT = new
DateTimeFormatterBuilder()
.optionalStart()
.appendChronologyId()
.appendLiteral(' ')
.optionalEnd()
.optionalStart()
.appendText(ChronoField.ERA, TextStyle.FULL) // FAILS HERE
.appendLiteral(' ')
.optionalEnd()
.appendValue(ChronoField.YEAR_OF_ERA, 1, 9, SignStyle.NORMAL)
.appendLiteral('-')
.appendValue(ChronoField.MONTH_OF_YEAR, 1, 2, SignStyle.NEVER)
.appendLiteral('-')
.appendValue(ChronoField.DAY_OF_MONTH, 1, 2, SignStyle.NEVER)
.toFormatter();
will parse HijrahDate and JapaneseDate toString values, but not MinguoDate
or ThaiBuddhistDate. It fails when trying to parse the era. I've also tried
TextStyle.Short, appendPattern("G") and appendPattern("GGGG"). All fail in
exactly the same place.
CHRONO_FORMAT.parse(HijrahDate.of(1970, 02, 03).toString());
CHRONO_FORMAT.parse(JapaneseDate.of(1970, 02, 03).toString())
CHRONO_FORMAT.parse(MinguoDate.of(1970, 02, 03).toString());
CHRONO_FORMAT.parse(ThaiBuddhistDate.of(1970, 02, 03).toString());
DateTimeFormatterBuilder()
.optionalStart()
.appendChronologyId()
.appendLiteral(' ')
.optionalEnd()
.optionalStart()
.appendText(ChronoField.ERA, TextStyle.FULL) // FAILS HERE
.appendLiteral(' ')
.optionalEnd()
.appendValue(ChronoField.YEAR_OF_ERA, 1, 9, SignStyle.NORMAL)
.appendLiteral('-')
.appendValue(ChronoField.MONTH_OF_YEAR, 1, 2, SignStyle.NEVER)
.appendLiteral('-')
.appendValue(ChronoField.DAY_OF_MONTH, 1, 2, SignStyle.NEVER)
.toFormatter();
will parse HijrahDate and JapaneseDate toString values, but not MinguoDate
or ThaiBuddhistDate. It fails when trying to parse the era. I've also tried
TextStyle.Short, appendPattern("G") and appendPattern("GGGG"). All fail in
exactly the same place.
CHRONO_FORMAT.parse(HijrahDate.of(1970, 02, 03).toString());
CHRONO_FORMAT.parse(JapaneseDate.of(1970, 02, 03).toString())
CHRONO_FORMAT.parse(MinguoDate.of(1970, 02, 03).toString());
CHRONO_FORMAT.parse(ThaiBuddhistDate.of(1970, 02, 03).toString());
- backported by
-
JDK-8084654 DateTimeFormatter does not parse/accept the era.toString() result from MinguoEra/ThaiBuddhistEra
-
- Resolved
-