I am trying to remove current date highlight and restrict future and current date from selecting, I tried this below code
$(".datepick").datepicker("destroy");
$(".datepick").datepicker({
dateFormat: 'dd/mm/yy',
showOtherMonths: true,
selectOtherMonths: true,
maxDate: 0,
});
This above one is restricting future dates but not current date.
$(".ui-datepicker-today a").removeClass("ui-state-default ui-state-highlight ui-state-active");
tried this too to remove the current date highlight but it is not removing.
2
Answers
You’re very close. According to the documentation a value of
-1
will set the maximum date to yesterday: