Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: How to disable past dates with liferay-ui:input-date
Hey, everyone!
I was trying to disable in the calendar and in the liferay-ui:input-date the value of a past date (allow just the dates after now), but I haven't found a solution on the Internet. Could anyone help me?
My code is here (JSP):
<liferay-ui:input-date
name="fechaPubl" yearValue="<%=nowDate.get(nowDate.YEAR)%>"
monthValue="<%=nowDate.get(nowDate.MONTH)%>"
dayValue="<%=nowDate.get(nowDate.DAY_OF_MONTH)%>" dayParam="dateFrom-day"
monthParam="dateFrom-month" yearParam="dateFrom-year">
</liferay-ui:input-date>
Thanks ind advance!
You can use the firstEnabledDate parameter like this:
<liferay-ui:input-date firstEnabledDate="<%= new Date() %>" />
Hope it helps.
Hi, have you tried the firstEnabledDate attribute? Just add
firstEnabledDate="<%=new Date()%>"
Take a look here liferay-ui/input-date
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™