How to Datepicker picks future dates only and disable past date in JQuery and CSS?
To make any past dates unselectable, you first have to find the instantiation of the datepicker, and set the minDate
setting to zero.
$('element').datepicker({
minDate : 0
});
Use datepicker's minDate() method you can find api details http://api.jqueryui.com/datepicker/
$( ".selector" ).datepicker({
minDate: new Date()
});
for this first you have to import jQuery-UI script https://code.jquery.com/ui/
I hope this will work.
Best solution for disable past dates and picks only future dates is:
Try this, it is working in my case:
$( ".selector" ).datepicker({
startDate: new Date()
});