Skip to content

[7.x] Enable ResolverStyle.STRICT for java formatters (#46675)#47913

Merged
pgomulka merged 2 commits intoelastic:7.xfrom
pgomulka:backport/7.x/pr-46675
Oct 11, 2019
Merged

[7.x] Enable ResolverStyle.STRICT for java formatters (#46675)#47913
pgomulka merged 2 commits intoelastic:7.xfrom
pgomulka:backport/7.x/pr-46675

Conversation

@pgomulka
Copy link
Copy Markdown
Contributor

Backports the following commits to 7.x:

Joda was using ResolverStyle.STRICT when parsing. This means that date will be validated to be a correct year, year-of-month, day-of-month
However, we also want to make it works with Year-Of-Era as Joda used to, hence custom temporalquery.localdate in DateFormatters.from
Within DateFormatters we use the correct uuuu year instead of yyyy year of era

worth noting: if yyyy(without an era) is used in code, the parsing result will be a TemporalAccessor which will fail to be converted into LocalDate. We mostly use DateFormatters.from so this takes care of this. If possible the uuuu format should be used.
@pgomulka pgomulka added the :Core/Infra/Core Core issues without another label label Oct 11, 2019
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Core)

@pgomulka pgomulka self-assigned this Oct 11, 2019
@pgomulka
Copy link
Copy Markdown
Contributor Author

@elasticmachine run elasticsearch-ci/packaging-sample-matrix

@pgomulka pgomulka merged commit 6ab58de into elastic:7.x Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Core/Infra/Core Core issues without another label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants