简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM