Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6576

Support multiple dateFormats for LocalDateTextfield

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 8.0.0
    • 8.1.0, 9.0.0-M1
    • wicket
    • None

    Description

      When I use the dateFormat of "dd.MM.yyyy" than an input of "1.1.2018" is invalid.

      When I use the dateFormat of "d.M.yyyy" than an input of "01.01.2018" is valid but converted to "1.1.2018" after form submission.

      When I use the dateFormat of "[d.M.yyyy][dd.MM.yyyy]" than an input of "1.1.2018" and "01.01.2017" are both valid, but converted to "1.1.201801.01.2018" after form submission. This is because the dateFormat is used for both: Parse the user input as LocalDate and than transform back the LocalDate to the representation String.

       

      Would it be possible to allow multiple dateFormats for input parsing and one output dateFormat that is applied after form submission?

       

      I could easily write my own LocalDateTextField class but this feature should be provided by wicket itself since I do not want to wrapp all wicket classes.

      Attachments

        Activity

          People

            svenmeier Sven Meier
            michaelgerhards Michael Gerhards
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 8h
                8h
                Remaining:
                Remaining Estimate - 8h
                8h
                Logged:
                Time Spent - Not Specified
                Not Specified