title: Range and DisplayFormat Attributes on TimeSpan
body: <p>I am building a Scheduling Screen and need to display a Time field for users to enter the time of day for the schedule.</p>
  
  <p>I'm not sure if this is the best option, but I am using a TimeSpan for the field. To validate the input, I want to use the Range attribute and the DisplayFormat attribute.</p>
  
  <p>When I debug and enter a seeming valid value, the Range attribute indicates an out of range error.  Can anyone see what I am doing wrong?  Is TimeSpan the proper type for this usage? Any help is greatly appreciated.</p>
  
  <p><strong>Model Class:</strong></p>
  
  <pre><code>public class Schedule
  {
      public Schedule()
      {
          this.ScheduleTime = new TimeSpan(0, 0, 0);
      }
  
      /// &lt;summary&gt;
      /// The time of day for the schedule to run
      /// &lt;/summary&gt;
      [Required, DataType(System.ComponentModel.DataAnnotations.DataType.Time),
      Display(Name = "Schedule Time", Description = "Number of Hours and Minutes after Midnight Central Timezone"),
      DisplayFormat(DataFormatString = @"{0:hh\:mm\:ss}", ApplyFormatInEditMode = true),
      Range(typeof(TimeSpan), "00:00", "23:59")]
      public TimeSpan ScheduleTime { get; set; }
  }
  </code></pre>
  
  <p><strong>Error Message:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/K28pT.png" alt="Error Message"></p>