下面的片段属于选择两个日期,我必须为此添加另一个功能,即结束日期选择应限制为比开始日期大一天
$(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 );
}
});
});
提前谢谢!!!