我有以下(工作)JavaScript 日期选择器。“out”mindate 等于 1。如何使“out”mindate 等于我的访问者选择的日期和今天的日期之间的差异,而不是 1?
$(function() { var dateSelected = false;
$( "#in" ).datepicker({
minDate: 0,
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onClose: function(dateText, inst) {
dateSelected = true;
}
});
$('form').submit(function(){
if (!dateSelected) {
alert('Please Enter start Dates');
}
return dateSelected;
});
});
$(function() { var dateSelected = false;
$( "#out" ).datepicker({
minDate: 1,
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onClose: function(dateText, inst) {
dateSelected = true;
}
});
$('form').submit(function(){
if (!dateSelected) {
alert('Please Enter end Dates');
}
return dateSelected;
});
});
谢谢你的热心帮助。