Skip to content

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

Closed

Description

@spring-projects-issues

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

Activity

  1. spring-projects-issues commented on Jan 30, 2018

    @spring-projects-issues
    CollaboratorAuthor

    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).

  2. spring-projects-issues commented on Jan 30, 2018

    @spring-projects-issues
    CollaboratorAuthor

    Michał Sobkiewicz commented

    Great! Thanks a lot! :)

  3. added
    type: enhancement
    in: core
    on Jan 11, 2019
  4. added this to the 5.0.4 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coretype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions