I am defining a formatter as follows:
private static final DateTimeFormatter FORMATTER =
new DateTimeFormatterBuilder()
.parseCaseInsensitive()
.appendLiteral("y")
.appendValue(IsoFields.WEEK_BASED_YEAR, 4, 10, SignStyle.EXCEEDS_PAD)
.appendLiteral("w")
.appendValue(IsoFields.WEEK_OF_WEEK_BASED_YEAR, 2)
.toFormatter();
I am inputting the following strings which I believe should be valid using the following parsing call:
LocalDate.parse(inputString, FORMATTER).atStartOfDay()
With the following values of inputString:
- y2019w52
- y2020w01
- y2019w03
All are throwing parsing errors, for example:
Text 'y2019w03' could not be parsed: Unable to obtain LocalDate from TemporalAccessor: {WeekOfWeekBasedYear=3, WeekBasedYear=2019},ISO of type java.time.format.Parsed
any ideas?