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

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -