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

Select time other than interval time

1 Answer 315 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Partha
Top achievements
Rank 1
Partha asked on 28 Aug 2015, 04:23 AM

Dear Kendo UI Team,

 I'm using Kendo ui datetimepicker where I've set interval as 15.

As, interval is 15 if I open up time picker icon then it displays 12:00 AM, 12:15 AM ... 11:45 PM which is correct.

Now, my question is if I manually save time as 02:17 PM then while editing when I click on time picker icon I want automatically set time as 2:15 PM or 2:30 PM, how can I achieve this? If time is part of interval then it automatically selects but if not then in that case how can I make it possible?

Waiting for your answer, many thanks.

 

 

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 28 Aug 2015, 10:44 AM
Hello Hemanth,

There is no built-in option to achieve such an automatic value change. By design, such manipulation of the value assigned is not recommended behavior for an UI component.

However, as a custom solution, you can use the widget's events to detect the opening of the Time Popup (http://docs.telerik.com/KENDO-UI/api/javascript/ui/datetimepicker#events-open), parse the currently selected value, round it via JS approach (this Stackoverflow thread would be useful—http://stackoverflow.com/questions/4968250/how-to-round-time-to-the-nearest-quarter-hour-in-javascript) and finally, assign the result from the round operation to the DateTime input  (http://docs.telerik.com/KENDO-UI/api/javascript/ui/datetimepicker#methods-value).

Regards,
Ianko
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Date/Time Pickers
Asked by
Partha
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or