Kendo datepicker(monthpicker)禁用特定月份

时间:2015-01-15 07:25:35

标签: jquery kendo-ui kendo-datepicker

$("#monthpicker").kendoDatePicker({
  // defines the start view
  start: "year",

  // defines when the calendar should return date
  depth: "year",

  // display month and year in the input
  format: "MMMM yyyy"
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://cdn.kendostatic.com/2011.3.1129/js/kendo.all.min.js"></script>
<link href="http://cdn.kendostatic.com/2011.3.1129/styles/kendo.blueopal.min.css" rel="stylesheet" />
<link href="http://cdn.kendostatic.com/2011.3.1129/styles/kendo.common.min.css" rel="stylesheet" />

<input id='monthpicker' style='width:150px' />

这就是我所做的。我希望在特定月份之后禁用所有月份 例如:我想在2014年10月之后禁用所有月份。请注意,kendo datepicker定义为 start:“year”“

1 个答案:

答案 0 :(得分:7)

尝试使用:

$("#monthpicker").kendoDatePicker({
    min: new Date(2013, 10, 30) // sets min date to Nov 30th, 2013
});

$("#monthpicker").kendoDatePicker({
    max: new Date(2014, 10, 0) // sets max date to Oct 31st, 2014
});