Format date in using DateTimeConverter

前端 未结 3 461
面向向阳花
面向向阳花 2021-01-24 19:22

I have a that has with CategoryHistory objects loaded in it. I only show the Date date

3条回答
  •  灰色年华
    2021-01-24 20:04

    Unfortunately, the JSF converters only applies on the input value, not on the input label.

    You'll need to solve this other ways. E.g. a getter which uses SimpleDateFormat to format the date. Or if your environment supports EL 2.2, simply invoke the converter method directly (you've it as managed bean already):

    
    

    If you happen to use JSF utility library OmniFaces, then you can also use its of:formatDate() function. E.g.:

    
    

提交回复
热议问题