title: Parameter is null while it shouldn't be
body: <p>I am running to a somewhat weird bug in this very early morning.
  The error is simple</p>
  
  <blockquote>
    <p>The parameters dictionary contains a null entry for parameter 'FirstDate' of non-nullable type 'System.DateTime' for method 'System.Web.Mvc.ActionResult GeneratePDF(System.DateTime, System.DateTime)' in 'TimeRegPlanner.Controllers.TimeRegistrationController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
    Parameter name: parameters</p>
  </blockquote>
  
  <p>The controller looks like this</p>
  
  <pre><code>public ActionResult GeneratePDF(DateTime FirstDate, DateTime LastDate)
  {
      return Json(new { success = true }, JsonRequestBehavior.AllowGet);
  }
  </code></pre>
  
  <p>and here is the JavaScript:</p>
  
  <pre><code>function CreatePDF() {
      var xyz = document.getElementById("regDate").valueAsDate
     // var ShopDocCode = document.getElementById("werkkaart").value
  
      var first = xyz.getDate() - xyz.getDay() + 1;
      var last = first + 6; // last day is the first day + 6
  
      var firstday = new Date(xyz.setDate(first)).toUTCString();
      var lastday = new Date(xyz.setDate(last)).toUTCString();
      alert(firstday);
      alert(lastday);
      var x = document.getElementById("checkBox").checked;
      if (x === true) {
          window.location = appPath + "/TimeRegistration/GeneratePDF?FirstDate=" + firstday + "&amp;LastDate=" + lastday;
      }
  
      setTimeout(function () {
          $("#dialog-Confirm").modal("hide");
      }, 3000);
  
  }
  </code></pre>
  
  <p>when I debug and console.log the firstday and the lastday I can see they have proper values:</p>
  
  <blockquote>
    <p>firstday: Mon, 24 Jun 2019 00:00:00 GMT lastday: Sun, 30 Jun 2019
    00:00:00 GMT</p>
  </blockquote>