[英]jQuery Datepicker minDate not set
我有两个日期选择器“ startDate”和“ targetDate”。我想将“ targetDate”的minDate设置为“ startDate”的值。以下代码不起作用。即,未设置“ targetDate”的minDate。
$("#startDate").datepicker({
changeMonth : true,
changeYear : true,
dateFormat : "dd-M-yy",
minDate : 0,
showMonthAfterYear : true,
onClose : function() {
$(this).toggleClass('ui-state-focus');
}
});
$("#targetDate").datepicker({
changeMonth : true,
changeYear : true,
dateFormat : "dd-M-yy",
minDate : new Date($("#startDate").val()),
showMonthAfterYear : true,
onClose : function() {
$(this).toggleClass('ui-state-focus');
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.