I am trying to set the max date for the uidatepicker in my html page using jQuery. I have tried the following:
$(function() {
var theDate = new Date();
$( "#datepicker" ).datepicker(
{
dateFormat: 'dd/mm/yy',
maxDate: new Date(theDate.getYear(), theDate.getMonth(), theDate.getDate());
}
);
This doesn’t work….What am I doing wrong? I want to make it so the date picker has a max date of today’s date…
You have a
;at the end of themaxDate: ...line that shouldn’t be there. Looks like it would result in a syntax error.Does your browser’s error console tell you there’s a JavaScript error of some kind?