嘗試
此:
<label for="from">From</label> <input type="text" id="from" name="from"/>
<label for="to">to</label> <input type="text" id="shootdate" name="to"/>
var dateToday = new Date();
var dates = $("#from, #shootdate").datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
minDate: dateToday,
onSelect: function(selectedDate) {
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $(this).data("datepicker"),
date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
dates.not(this).datepicker("option", option, date);
}
});
搜索在谷歌:在datepicker''禁用以前的日期。你一定會得到答案 –
是的。我該怎麼辦? :( –
http://stackoverflow.com/questions/25053119/how-to-inactive-previous-date-in-bootstrap-datepicker/25053271#25053271 – Confused