NeplatnyUdaj
NeplatnyUdaj

Reputation: 6242

Primefaces calendar picker doesn't work with MMM pattern

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.

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

Upvotes: 0

Views: 1388

Answers (1)

Vinayak Pingale
Vinayak Pingale

Reputation: 1315

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.

enter image description here

Upvotes: 2

Related Questions