title: Validating time-only input in asp.net MVC unobtrusive validation
body: <p>I have two separate fields on the page: one for date and one for time.</p>
  
  <p>This is the model:</p>
  
  <pre><code>[Required]
  [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:hh:mm tt}")]
  public DateTime? StartTime { get; set; }
  
  [Required]
  [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
  public DateTime Date { get; set; }
  </code></pre>
  
  <p>This is the view:</p>
  
  <pre><code>@Html.TextBoxFor(m =&gt; m.Date, "{0:MM/dd/yyyy}", new { type = "text" })
  @Html.TextBoxFor(m =&gt; m.StartTime, "{0:hh:mm tt}", new { type = "text", id = "timeStart" })
  </code></pre>
  
  <p>The javascript unobtrusive validation works fine with the <code>Date</code> field however when i enter "11:00 PM" or "11:00 pm" in <code>StartTime</code> the validation shows </p>
  
  <blockquote>
    <p>"The field StartTime must be a date"</p>
  </blockquote>
  
  <p>Server side validation works fine with <code>"0:hh:mm tt"</code> it's only the javascript that has a problem. For now i just disabled javascript validation but would like eventually to have it on this page</p>
  
  <p>Can this be done for "time" field?</p>