Hi there,
I'm trying to use the TimePicker with ASP.NET MVC 4.0 but keep seeing the validation message "The field StartTime must be a valid date" as soon as I select a time no matter what time I select. The TimePicker is bound to a DateTime property in a model object as follows.
@Html.Telerik().TimePickerFor(m => m.StartTime).Interval(60)
@Html.ValidationMessageFor(m => m.StartTime)
Here's the generated HTML:
<div class="t-widget t-timepicker"><div class="t-picker-wrap"><input class="t-input" data-val="true" data-val-date="The field StartTime must be a date." data-val-required="The StartTime field is required." id="StartTime" name="StartTime" type="text" value="6:24 PM" /><span class="t-select"><span class="t-icon t-icon-clock" title="Open the time view">Open the time view</span></span></div></div>
I also have the following below:
jQuery(
'#StartTime').tTimePicker({format:'h:mm tt', minValue:new Date(2012,2,8,0,0,0,0), maxValue:new Date(2012,2,8,0,0,0,0), interval:60, selectedValue:new Date(2012,2,8,18,24,6,627)});
Any thoughts why I keep seeing the validation message even though I'm selecting a valid time?
Thanks much.
Deepak.