Kendo ui 如何在剑道日期选择器中阻止日期

Kendo ui 如何在剑道日期选择器中阻止日期,kendo-ui,kendo-datepicker,Kendo Ui,Kendo Datepicker,有没有办法阻止剑道日期选择器的约会?因此,如果他们单击打开日历,并希望选择12月10日,我可以禁用或删除该日期(最好禁用)。我没有看到任何关于如何做到这一点的文档 <div id="datePicker"></div> $('#datePicker').kendoDatePicker({ // I need it dynamically done, I don't want to hard code the date. // So if the user

有没有办法阻止剑道日期选择器的约会?因此,如果他们单击打开日历,并希望选择12月10日,我可以禁用或删除该日期(最好禁用)。我没有看到任何关于如何做到这一点的文档

<div id="datePicker"></div>

$('#datePicker').kendoDatePicker({
   // I need it dynamically done, I don't want to hard code the date. 
   // So if the user clicks it, a request will be handled to send back any dates that are previously taken.
});

$(“#日期选择器”).kendoDatePicker({
//我需要动态完成,我不想硬编码日期。
//因此,如果用户单击它,将处理一个请求,以发回以前记录的任何日期。
});

对于12月10日,您可以这样做:

$("#datepicker").kendoDatePicker({
    value: new Date(2019,11,5),
    disableDates: [new Date(2019,11,10)]
});
disableDates可以是数组或函数。您可以使用日期或工作日名称。请查看我的评论中的文档以了解更多信息。请注意11是第12个月

如果您想使用函数,以下是如何使用:

disableDates: function (date) {
    var dates = $("#datepicker").data("kendoDatePicker").options.dates;
                if (your condition) {
                    return true;
                } else {
                    return false;
                }
            }
第一次谷歌点击:-)