【发布时间】:2017-03-30 15:29:03
【问题描述】:
我正在运行 uxsolutions / bootstrap-datepicker (https://github.com/uxsolutions/bootstrap-datepicker)。
我已经在弹出日历小部件中禁用了日期,很好(参见下面的代码)。然而,在日期的文本框中,我可以输入禁用的日期(下面的屏幕截图)。
如何让日期框识别禁用的日期并阻止它们被输入?
$('#eventDate-container .input-group.date').datepicker({
weekStart: 1, // calendar starts on Monday
autoclose: true,
todayHighlight: true,
startDate: "4/10/2017", // disables all dates prior to this date
datesDisabled: ['01/01/1970', '12/31/2099'] // placeholder sample for possible future use
});
【问题讨论】: