I am trying to configure my kendoDateTimePicker to show 9am to 6pm only. Is this possible?
In the Data type Format dialog box, do one of the following: To format the control to show the date only, select the display style that you want in the Display the date like this list. To format the control to show the time only, select the display style that you want in the Display the time like this list.
To display the time with the DateTimePicker control Set the ShowUpDown property for the DateTimePicker to true .
The JavaScript DateTime Picker is a lightweight and mobile-friendly control that allows end users to enter or select date and time values from a pop-up calendar and drop-down time list. It provides month, year, and decade views for quick navigation to the desired date.
Time pickers allow users to enter a specific time value. They can be used for a wide range of scenarios. Common use cases include: Setting an alarm. Scheduling a meeting.
I know it's has been a while since this question has been asked. but i will add my response for future reference.
kendo DateTimePicker does not support adding a range to the TimePicker. But you can add your own widget that does that.
(function($) {
var dateTimePicker = kendo.ui.DateTimePicker;
var MyWidget = dateTimePicker.extend({
init: function(element, options) {
dateTimePicker.fn.init.call(this, element, options);
},
startTime: function(startTime) {
var timeViewOptions = this.timeView.options;
timeViewOptions.min = startTime;
this.timeView.setOptions(timeViewOptions);
},
endTime: function(endTime) {
var timeViewOptions = this.timeView.options;
timeViewOptions.max = endTime;
this.timeView.setOptions(timeViewOptions);
},
options: {
name: "CustomDateTimePicker"
}
});
kendo.ui.plugin(MyWidget);
})(jQuery);
Then you can call your CustomDateTimePicker
like this :
var datePicker = $("#date-picker").kendoCustomDateTimePicker().data("kendoCustomDateTimePicker");
datePicker.startTime("07:00");
datePicker.endTime("11:00");
jsfiddle demo.
var startDateReference = $('.startDate').kendoDateTimePicker({
format: "dd-MM-yy HH:mm:ss",
value : new Date(),
}).data("kendoDateTimePicker");
startDateReference.timeView.options.min = new Date(2000, 0, 1, 7, 30, 0);
startDateReference.timeView.options.max = new Date(2000, 0, 1, 18, 00, 0);
This is working for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With