This is a migrated thread and some comments may be shown as answers.

DateTimePicker Custom Time Interval

2 Answers 204 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Kong
Top achievements
Rank 1
Kong asked on 23 Mar 2017, 02:53 PM

I currently have the Date/Time picker set to a time interval of 240 minutes, which is 12:00AM, 4:00AM, 8:00AM, 12:00PM, 4:00PM, and 8:00PM.  I would like to only show 8:00AM and 8:00PM.  Is this achievable?

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin
Telerik team
answered on 24 Mar 2017, 02:53 PM
Hello,

Please take a look at this how-to example. In your case the open handler would look something similar to this:

$("#datetimepicker").kendoDateTimePicker({
    ....
    open: function (e) {
        if (e.view === "time") {
            e.sender.timeView.dataBind([
              new Date(1970, 0, 1, 8),
              new Date(1970, 0, 1, 20)
            ])
        }
    }
});

Regards,
Martin
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Kong
Top achievements
Rank 1
answered on 24 Mar 2017, 08:37 PM
Thank you Martin!
Tags
Date/Time Pickers
Asked by
Kong
Top achievements
Rank 1
Answers by
Martin
Telerik team
Kong
Top achievements
Rank 1
Share this question
or