更新时间:2023-01-27 16:29:45
您需要使用选项方法在更改开始日期时设置
You need to set it using the option method on change of start date
$("#txtstartdate").datepicker({
minDate: 0,
onSelect: function(date) {
$("#txtenddate").datepicker('option', 'minDate', date);
}
});
$("#txtenddate").datepicker({});
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/redmond/jquery-ui.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.js"></script>
<input id="txtstartdate" />
<input id="txtenddate" />