Telerik Extensions for ASP.NET MVC

Enabling and disabling the timepicker

The Enable method enables or disables the timepicker depending on the argument (true or false). If the timepicker is disabled user input is prohibbited. By default the timepicker is enabled.
CopyDisabling the timepicker
<%= Html.Telerik().TimePicker()
        .Name("time")
        .Enable(false)
%>

Setting the acceptable time format

The Format method specifies the time format which the timepicker accepts. By default the format is set to the ShortTimePattern property of the current culture (which is retrieved from CurrentCulture)
CopySetting the timepicker format
<%= Html.Telerik().TimePicker()
        .Name("time")
        .Format("HH:mm tt") // 24 hours with AM/PM designator
%>

Setting the time interval in the timepicker drop-down

The Interval method specifies the interval (step) in minutes in the drop-down which is displayed when the user clicks the timepicker button. The default interval is 30 (minutes).
CopySetting the interval of the timepicker
<%= Html.Telerik().TimePicker()
        .Name("time")
        .Interval(60)
%>

Setting the maximum allowed value

The Max method sets the maximum value of the timepicker. It has tree overloads accepting DateTime?, TimeSpan? or string as argument.
CopySetting the maximum value from string
<%= Html.Telerik().TimePicker()
        .Name("time")
        .Max("10:30 AM")
%>
CopySetting the maximum value from TimeSpan
<%= Html.Telerik().TimePicker()
        .Name("time")
        .Max(new TimeSpan(10, 30, 0))
%>
CopySetting the maximum value from DateTime
<%= Html.Telerik().TimePicker()
        .Name("time")
        .Max(DateTime.Now)
%>

Setting the minimum allowed value

The Min method sets the minimum value of the timepicker. It has tree overloads accepting DateTime, TimeSpan or string as argument.
CopySetting the minimum value from string
<%= Html.Telerik().TimePicker()
        .Name("time")
        .Min("10:30 AM")
%>
CopySetting the minimum value from TimeSpan
<%= Html.Telerik().TimePicker()
        .Name("time")
        .Min(new TimeSpan(10, 30, 0))
%>
CopySetting the minimum value from DateTime
<%= Html.Telerik().TimePicker()
        .Name("time")
        .Min(DateTime.Now)
%>

Showing and hiding the timepicker button

The ShowButton shows or hides the timepicker button. That button is used to open the hours drop-down and is visible by default.
CopyHiding the timepicker button
<%= Html.Telerik().TimePicker()
        .Name("time")
        .ShowButton(false)
%>

Setting the TimePicker Value

The Value method sets the value (time) displayed by the timepicker. It has tree overloads accepting DateTime?, TimeSpan? or string as argument.
CopySetting the value from string
<%= Html.Telerik().TimePicker()
        .Name("time")
        .Value("10:30 AM")
%>
CopySetting the value from TimeSpan
<%= Html.Telerik().TimePicker()
        .Name("time")
        .Value(new TimeSpan(10, 30, 0))
%>
CopySetting the value from DateTime
<%= Html.Telerik().TimePicker()
        .Name("time")
        .Value(DateTime.Now)
%>