The maxdate and mindate attribute is extremely useful for setting available date range for user selection.
e.g.
-Expiry date of an item should not be less than today.
-Date of birth should not be future date.
e.g.
-Expiry date of an item should not be less than today.
-Date of birth should not be future date.
So how to set maxdate and mindate in PrimeFaces calendar component?
1. create the java.util.date object in backingBean
2. set the java.util.date object as mindate or maxdate
Done!!
1. create the java.util.date object in backingBean
private Date currentDate = new Date();
public Date getCurrentDate() {
return currentDate;
}
2. set the java.util.date object as mindate or maxdate
<p:calendar value="#{bean.expiryDate}" mindate="#{bean.currentDate}" />
<p:calendar value="#{bean.birthDate}" maxdate="#{bean.currentDate}" />
Done!!
Here is the list of best free and paid Windows 10 apps that you should definitely use,
ReplyDeleteespecially if you are using Windows 10 laptop or Apps for PC.