Announcement Announcement Module
Collapse
No announcement yet.
Formatting <form:input/> Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Formatting <form:input/>

    Hello,

    is there a way to format a date displayed by <form:input path="issueDate"/>?

    At runtime, this tag displays the issue date as YYYY-MM-DD, which is not particularly user-friendly. I would like it to be displayed as DD/MM/YYYY.

    Many thanks.

    Philroc

  • #2
    I found the solution in one of the forums:


    @InitBinder
    public void initBinder(WebDataBinder binder) {

    SimpleDateFormat dateFormat = New SimpleDateFormat("dd/MM/yyyy");

    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true);

    }

    in my Controller class

    Comment

    Working...
    X