New to Kendo UI for jQuery? Download free 30-day trial

Disable Dynamically Dates in the Calendar

Environment

Product Progress® Kendo UI® Calendar for jQuery
Product Version 2017.3.1026

Description

How can I disable dates in the Calendar after the widget was initialized?

Solution

  1. Destroy the Calendar by using the destroy method.
  2. Initialize the Calendar with the disabled dates.
    <div id="calendar"></div>
    <a class="k-button" onclick="changeDisableDates()">Disable dates</a>
    <script>
      $("#calendar").kendoCalendar();

      function changeDisableDates() {
        var calendar = $('#calendar').data('kendoCalendar');
        var options = calendar.options;
        options.disableDates = ["mo", "sa"];

        calendar.destroy();
        $('#calendar').html('');
        $('#calendar').kendoCalendar(options);
      }
    </script>
In this article