I have two datepickers one for startDate and other for endDate which are initially set to current.
Now when I change startDate I want the 1. endDate should have minDate as selected date and 2. maxDate will be 2 months from the selected.
Step 1 is working but I have problem with step2 . my current code looks like this:
$( "#from" ).datepicker({
defaultDate: "+1w",
dateFormat: "yy-mm-dd",
changeMonth: true,
numberOfMonths: 3,
onClose: function( selectedDate ) {
$( "#to" ).datepicker( "option", "minDate", selectedDate );
$( "#to" ).datepicker( "option", "maxDate", "+2M" );
}
}).datepicker("setDate", "0");