title: Stop Validation on Empty DateTime field returning Invalid in ModelState Core 3
body: <p>I have a razor page with the following syntax</p>
  
  <pre><code> &lt;form method="post"&gt;
  
      &lt;input id="Text1" type="date" asp-for="@Model.PersonModel.DOB" /&gt;
  
      &lt;h2&gt;
          Is Valid: @ModelState.IsValid
      &lt;/h2&gt;
  
  
      &lt;input id="Submit1" type="submit" value="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In the code behind I have </p>
  
  <pre><code>    public IActionResult OnPost()
      {
          if (ModelState.IsValid)
          {
              //never hits here
          }
          return Page();
      }
  </code></pre>
  
  <p>In the person model I have </p>
  
  <pre><code>public class PersonModel
  {
      [DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)]
      [CustomDateTime()]
      public DateTime DOB { get; set; }
  }
  
  public class CustomDateTimeAttribute: ValidationAttribute
  {
  
      public CustomDateTimeAttribute()
      {
  
      }
  
  
      protected override ValidationResult IsValid(object value, ValidationContext validationContext)
      {
          return ValidationResult.Success;
          //return base.IsValid(value, validationContext);
      }
  }
  </code></pre>
  
  <p>When I enter nothing on the UI page, hit submit, if the date is empty it falls over and return Invalid, however I want it to return Valid if it empty and only return Invalid if the date is incorrect. I thought that by having he custom validator would help</p>