below snippet belongs to select two dates, i have to add another feature for that i.e, end date selection should be limited for one day greaterthan start date
$(function() {
$( "#fromDate" ).datepicker({
defaultDate: "+0",
changeMonth: true,
changeYear: true,
numberOfMonths: 1,
dateFormat:"yy-mm-dd",
onClose: function( selectedDate ) {
$( "#toDate" ).datepicker( "option", "minDate", selectedDate);
this.focus();
}
});
$( "#toDate" ).datepicker({
defaultDate: "+0",
changeMonth: true,
changeYear: true,
numberOfMonths: 1,
dateFormat:"yy-mm-dd",
onClose: function( selectedDate ) {
$( "#fromDate" ).datepicker( "option", "maxDate", selectedDate );
}
});
});
thx in advance!!!
Simple solution to your question, just the two line of js code and BINGO!!.
Just change the number as per requirement (In case you want to put Max days to 1 or more)