iamlarissa
iamlarissa

Reputation: 69

Kendo UI timepicker: disabled time values

I'm new to using Kendo UI timepicker. How do you disable specific values from the timepicker?

PHP (fetch array for time slot)

 $time = $row['Time'];

HTML

<input id="timepicker" value="10:00 AM" style="width: 100%;" />

JS

$(document).ready(function() {
     // create TimePicker from input HTML element
     $("#timepicker").kendoTimePicker();
});

Upvotes: 0

Views: 1984

Answers (1)

Steve Greene
Steve Greene

Reputation: 12314

You can explicitly set the values:

$("#timepicker").kendoTimePicker({
    dates: [
        new Date(2000, 10, 10, 10, 0, 0),
        new Date(2000, 10, 10, 10, 30, 0)
    ] //the drop-down list will consist only two entries - "10:00 AM" and "10:30 AM"
});

or you can set min, max and interval. Depends on what you need. http://docs.telerik.com/kendo-ui/api/javascript/ui/timepicker#configuration-dates

Upvotes: 1

Related Questions