Примерно так
<script>
$(function() {
$( "#from" ).datepicker({
changeMonth: true,
numberOfMonths: 2,
minDate: "today",
onClose: function( selectedDate ) {
var day1 = $("#from").datepicker('getDate').getDate()+1;
var month1 = $("#from").datepicker('getDate').getMonth()+1;
var year1 = $("#from").datepicker('getDate').getFullYear();
var nDate = year1+ "," + month1 + ","+day1;
nDate = new Date(nDate);
$( "#to" ).datepicker( "option", "minDate", nDate);
}
});
$( "#to" ).datepicker({
defaultDate: "+1d",
changeMonth: true,
numberOfMonths: 2,
onClose: function( selectedDate ) {
$( "#from" ).datepicker( "option", "maxDate", selectedDate );
}
});
});
</script>
</head>
<body>
<label for="from">From</label>
<input type="text" id="from" name="from" />
<label for="to">to</label>
<input type="text" id="to" name="to" />
|