1

In my app I am using Primefaces 5.3. I have problems with calendar pattern attribute. When I initialize the pattern by dd/MM/yyyy format, it is working properly and I can select and change the calendar date. When I change the pattern to dd/MM/yyyy HH:mm:ss, calendar component shows the date format but cannot be selected or changed.

Below is the calendar component that I used:

<p:calendar value="#{myBean.startDate}" showOn="button"
    locale="tr" showButtonPanel="true" navigator="true"
    id="startDate" pattern="dd/MM/yyyy HH:mm:ss">
</p:calendar>

In the backing bean the calendar component is initialized by java.util.date. Changing format to datetime as above, there is an error in Javascript Console as below:

Uncaught TypeError: this.jqEl.datetimepicker is not a function

Do I miss something?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
nudaStck
  • 311
  • 2
  • 6
  • 18

1 Answers1

0

Your calendar component looks fine to me, and java.util.date should also work fine with this component. The only reason I could think of is jsf configuration or jQuery vs Primefaces library conflict. Did you explicitly add them? Try to remove all redundant imports in this .xhtml or its parent like <h:outputScript ... />

Bazz
  • 11
  • 1
  • I have removed all the output script except the following one: ****. If I remove it then "datepicker is not a function" error is thrown. – nudaStck Mar 15 '16 at 19:21