Kendo datepicker(monthpicker) disable particular month

$("#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' />

This is what i have done. I want to disable all the months after a particular month.
For example: I want to disable all months after Oct 2014.Please note that the kendo datepicker is defined with start: "year"".

Upvotes: 2

Views: 3416

Answers (1)

Roy Doron
Roy Doron

Reputation: 595

Try to use:

$("#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
});

Upvotes: 3

Related Questions