jsf - How disable past and future dates in <p:calendar>? -
i need disable past dates current date , make available 3 upcoming dates current day in <p:calendar>
component primefaces. how this?
you can use mindate
, maxdate
attributes of <p:calendar>
component. example:
<p:calendar mindate="#{datebean.today}" maxdate="#{datebean.todayplusthree}" />
in datebean
bean, you'd have (at least) 2 getters content similar this:
public date gettoday() { calendar c = calendar.getinstance(); return c.gettime(); } public date gettodayplusthree() { calendar c = calendar.getinstance(); c.add(calendar.date, 3); return c.gettime(); }
Comments
Post a Comment