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

Using Date/Time Pickers with time interval define for programatically

2 Answers 117 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Erick Pessoa
Top achievements
Rank 1
Erick Pessoa asked on 18 Mar 2013, 05:25 AM
I am using Date/Time Pickers in application to scheduler task. But I don't need all list hours, so I want define the hours list.
It's possible ? Someone can help me?

If I can pass array list, resolve my problem.

2 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 19 Mar 2013, 02:01 PM
Hi Erick,

 
Basically in current scenario you should use two different widgets for the date and hour selection (DatePicker and TimePicker) - in that way you can define the possible hours using the dates array. Another option is to change the available hours of the DateTimePicker using custom code - please check the example below:

$(function () {
    var hoursFilter = [new Date(2000, 10, 10, 12, 0, 0), new Date(2000, 10, 10, 13, 0, 0), new Date(2000, 10, 10, 14, 0, 0), new Date(2000, 10, 10, 15, 0, 0)];
 
    function onChange() {
        //modify the available hours
        this.timeView.dataBind(hoursFilter);
    }
 
    $("#datetimepicker").kendoDateTimePicker({
        change: onChange
    });
 
    //modify the available hours
    $("#datetimepicker").data("kendoDateTimePicker").timeView.dataBind(hoursFilter);
})

 Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Erick Pessoa
Top achievements
Rank 1
answered on 27 Mar 2013, 03:10 AM
Hi Vladimir ...
Thanks for your answer.
Tags
Date/Time Pickers
Asked by
Erick Pessoa
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Erick Pessoa
Top achievements
Rank 1
Share this question
or