I have two datepickers:
$('#Date1, #Date2').datepicker({
defaultDate: +1,
minDate: +1
});
Whenever I select a date in Date1, I want to set this picked date as the minDate in Date2. I setted a function call for the onclick of Date1.
function RefreshDate2() {
$("#Date2").datepicker({
defaultDate: $("#Date1").datepicker("getDate"),
minDate: $("#Date1").datepicker("getDate")
});
$("#Date2").datepicker("refresh");
}
The function runs but it doesn't work, the minDate of Date2 still is the today+1 (as configured in the first sentence). Any ideas on how to fix it?
Thanks in advance!