telerik-datepicker

Telerik Datetime picker- Time shows 30 minutes span


@Html.Telerik().DateTimePickerFor(model => model.DepartureTime).Value(Model.DepartureTime > DateTime.MinValue ? Model.DepartureTime : DateTime.Today).ClientEvents(events => events.OnChange("OnChangeDatePicker")) 

In Telerik datetime picker, The Time is 30 minutes span. Like 9, 9.30, 10, 10.30 etc. Is there a way to select time For each minutes eg: 9.00, 9.01,9.02 etc..?


Solution

  • Here is the documentation for what you are looking for:

    http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-datetimepicker-configuration.html#Interval

    Basically you want to set the Interval configuration option to 1 such as.

    @Html.Telerik().DateTimePickerFor(model => model.DepartureTime)
                   .Interval(1)
                   .Value(Model.DepartureTime > DateTime.MinValue ? Model.DepartureTime : DateTime.Today)
                   .ClientEvents(events => events.OnChange("OnChangeDatePicker"))
    

    Now I havent tested this exact scenario but the documentation speaks for itself.

    Cheers, Nico