Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing java.time.Year Formatter [SPR-16437] #20983

Closed
spring-projects-issues opened this issue Jan 30, 2018 · 2 comments
Closed

Missing java.time.Year Formatter [SPR-16437] #20983

spring-projects-issues opened this issue Jan 30, 2018 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jan 30, 2018

Michał Sobkiewicz opened SPR-16437 and commented

Please consider adding some kind of org.springframework.format.datetime.standard.YearFormatter (similarly to org.springframework.format.datetime.standard.YearMonthFormatter).

I believe it's more convenient and self-explanatory to use java.time.Year as param in e.g. handlers whenever it really means a year and so on.


Affects: 5.0.3

Issue Links:

Referenced from: commits ef2e169

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good point. The main reason why java.time.Year and also java.time.Month weren't covered before is because they didn't exist in Joda-Time (which is where our JSR-310 support originated).

I've added dedicated formatters for both java.time.Year and java.time.Month now, parsing the JSR-310 way for the former (i.e. simple year numbers) and leniently resolving the enum constant name in any case for the latter (i.e. not just "JANUARY" which worked before already but also "January" etc).

@spring-projects-issues
Copy link
Collaborator Author

Michał Sobkiewicz commented

Great! Thanks a lot! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants