title: How can I prevent a validation attribute from being generated?
body: <p>I have a <code>DateTime</code> property in my model, but I'm only interested in the time part:</p>
  
  <pre><code>public class MyModel
  {
      [Required, DataType.Time]
      public DateTime Time
  }
  </code></pre>
  
  <p>In my view, I output it like so:</p>
  
  <pre><code>@Html.EditorFor(model =&gt; model.Time)
  </code></pre>
  
  <p>This used to generate the following html in MVC 3:</p>
  
  <pre><code>&lt;input class="text-box single-line" data-val="true" 
      data-val-required="The Time field is required." 
      id="Time" name="Time" type="time" value="" /&gt;
  </code></pre>
  
  <p>Now I'm trying this with MVC 4, and this is the html generated:</p>
  
  <pre><code>&lt;input class="text-box single-line" data-val="true" 
      data-val-date="The field Time must be a date." 
      data-val-required="The Time field is required." 
      id="Time" name="Time" type="time" value="" /&gt;
  </code></pre>
  
  <p>There is an extra attribute <code>data-val-date</code> added, which results in a client side validation error, because a time (e.g. "10:30") isn't formated as a date. </p>
  
  <p>I suppose this is a bug in MVC 4 (<a href="https://connect.microsoft.com/VisualStudio/feedback/details/705643/a-data-val-date-attribute-is-generated-for-time-fields-in-asp-net-mvc-4">I reported it</a>)? But until it's resolved, is there any way to prevent this attribute from being generated? Or even better, is there a way to let it be generated as a <code>data-val-time</code> in stead, so I can provide my own client side validation method for time fields?</p>