Primefaces calendar picker doesn't work with MMM pattern

大憨熊 提交于 2020-01-06 12:30:29

问题


I'd like to use a Calendar component from the primefaces as shown here: PrimeFaces - ShowCase : Calendar - Time

<p:calendar id="startDateSelected" value="#{myBB.dateSelected}" 
pattern="dd/MMM/yyyy">

dateSelected is just a plain Date()

It works fine for the patterns mentioned in the showcase, but I'd like to use the following pattern:

dd-MMM-yyyy HH:mm

When I use this, the dialog with picker doesn't show up. When I remove the time from the pattern, the picker works(only for date obviously) and if I change MMM to MM, it also works.

  • dd-MMM-yyyy works
  • dd-MM-yyyy HH:mm works
  • dd-MMM-yyyy HH:mm doesn't work

So the only problem is a combination of MMM and time. Any ideas?


回答1:


I have used following pattern at my side.

EEE, dd MMM, yyyy

<p:calendar value="#{calendarBean.date3}" pattern="EEE, dd/MMM/yyyy HH:mm" />

EEE, dd MM, yyyy

<p:calendar value="#{calendarBean.date2}" pattern="EEE, dd MM, yyyy HH:mm" />

It is wokring fine on my side.



来源:https://stackoverflow.com/questions/20476680/primefaces-calendar-picker-doesnt-work-with-mmm-pattern

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!