我有两个日期选择器,一个是DOB,第二个是DateOfIssue
$( "#tenth_DOB" ).datepicker({
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
modal: false,
maxDate: "-1",
yearRange: "1947:2016",
onSelect: function(dateStr) {
$("#dl_DateofIssue").val("");
$("#dl_ExpiryDate").removeAttr("disabled");
$("#dl_ExpiryDate").val("");
$(this).valid();
}
});
$("#tenth_DateofIssue").datepicker({
changeMonth: true,
changeYear: true,
minDate: new Date(todayYear, todayMonth, today),
maxDate: -1,
dateFormat: 'dd-mm-yy',
yearRange: "-20:+0",
modal: false,
onSelect: function(dateStr) {
var d = $.datepicker.parseDate('dd-mm-yy', dateStr);
d.setFullYear(d.getFullYear());
//$("#DOB").datepicker("option","maxDate", dateStr)
d.setDate(d.getDate()-1);
$(this).valid();
}
});
如果用户选择了他的出生日期,我想将出生日期设定为从出生日期到当前日期,我该怎么办?
例如DOB是01-01-2000然后我需要将Dateofissue 01-01-2000设置为05-07-2016启用,其他日期被禁用。