I want to disable all the future dates after today in Jquery Ui Datepicker
Here is the Demo :
Code :
$( \"
Change maxDate to current date
maxDate: new Date()
It will set current date as maximum value.
In case you are appending Dtpicker,use the following code
$('#enddate').appendDtpicker({
"dateOnly": true,
"dateFormat": "YYYY-MM-DD",
"closeOnSelected": true,
maxDate: new Date()
});
maxDate: new Date()
its working fine for me disable with current date in date range picker
In my case, I have given this attribute to the input tag
data-date-start-date="0d"
data-date-end-date="0d"
datepicker doesnot have a maxDate as an option.I used this endDate option.It worked well.
> $('.demo-calendar-default').datepicker({
> autoHide: true,
> zIndex: 2048,
> format: 'dd/mm/yyyy',
> endDate: new Date()
> });
This worked for me endDate: "today"
$('#datepicker').datepicker({
format: "dd/mm/yyyy",
autoclose: true,
orientation: "top",
endDate: "today"
});
SOURCE