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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -