Calendar does not work with min-date

UI Components for JSF
Post Reply
veit1989
Posts: 30
Joined: 31 Aug 2010, 13:04

15 Oct 2010, 15:35

Hy folks,
I have a problem concerning the primefaces-calendar. First of all - the code:

Code: Select all

<p:calendar id="arrivalDate" pattern="dd. MM. yyyy" mindate="#{reservation.today}" onSelectUpdate="departureDate" readOnlyInputText="true" value="#{reservation.startDate}"/>

<p:calendar id="departureDate" pattern="dd. MM. yyyy" mindate="#{reservation.startDate}" readOnlyInputText="true" value="#{reservation.endDate}"/>
I think the scenario is a common scenario. With these two fields I want to define a time-frame where the start-date has to be at least the current date and the end-date has to be at least the formerly selected start-date. I defined a pattern (because we use this thin in Austria) --> that works.

But as soon as I add the mindate-attribute, everything gets messed up - what I mean:
The initial date is shown in the correct pattern (and the correct date: e.g. 14. 10. 2010). But when you click on the textfield (the calender opens) - the calender starts with a date that is in year 2016!! I don't know what I did wrong - everything was done according to the primefaces-documentation.

Help would be greatly appreciated - I use the following framworks/servers:
  • Open Source Edition Glassfish v3
  • Primefaces 2.1
  • Mohjarra 2.0.3
I couldn't find a solution so far - if there is another thread which holds the solution: I'm sorry - please simply post the link - thx. :roll:

Thx in advance & kind regards

veit1989
Posts: 30
Joined: 31 Aug 2010, 13:04

15 Oct 2010, 15:44

I now can be more precise. It only works if one gives a string in the same pattern to the "mindate"-attribute. If you use a simple java.util.Date it doesn't work. Is this a bug which should be entered in a ticket?

Thx & Rgds
veit1989

ethermion
Posts: 117
Joined: 25 Aug 2010, 15:11

20 Oct 2010, 15:01

I'm having the same problem. Enter a ticket.
Mojarra 2.2.8
Primefaces 5.1
Wildfly 8.2

ethermion
Posts: 117
Joined: 25 Aug 2010, 15:11

20 Oct 2010, 23:20

Mojarra 2.2.8
Primefaces 5.1
Wildfly 8.2

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests