Hi,
I am using calendar and mindate.
When I use a java.util.Date, it takes the days instead months and vice versa.
I red the javadoc; if you use String you have to use the pattern "MM/dd/yyyy", but if you use Date, it would take the fields from it in the correct order, I think.
I use this code:
<p:calendar id="calFrom" pattern="dd/MM/yyyy" startWeekday="1"
value="#{advSearchBean.dateFrom}"
onselectUpdate="calUntil"
selectListener="#{advSearchBean.dateSelected}"/>
<p:calendar id="calUntil" pattern="dd/MM/yyyy" startWeekday="1"
value="#{advSearchBean.dateUntil}"
mindate="#{advSearchBean.dateFrom}" />
AdvSearchBean.java
...
import java.util.Date;
...
private Date dateFrom;
...
(getters and setters also)
...
public void dateSelected(DateSelectEvent event) {
dateFrom=event.getDate();
}
...
when I select "1 of April of 2010" (01/04/2010) in calFrom, it saves it in Bean attribute dateFrom and update calUntil, but mindate was "4 of January of 2010" (04/01/2010) instead of "1 of April of 2010" (01/04/2010).
I am doing anything wrong?
Is mindate doing it wrong with Date class?
Thanks a lot.
I hope you can understand me.
PD: I use debug, and first Date is saved correctly to bean with correct atributes.
calendar: mindate pattern?
-
- Information
-
Who is online
Users browsing this forum: Baidu [Spider] and 33 guests