title: jquery date parser error getting NaN error
body: <p>I have written below function for setting date text field which is daterangepicker.js. On chrome console its throwing "gluingNaN/NaN/NaN-NaN/NaN/NaN "</p>
  
  <p>Code :</p>
  
  <pre><code>function onloadDate(){
      var d1=new Date(Date.parse('today -30days'));
      var date1=d1.getMonth()+1 +"/"+ d1.getDate() +"/"+ d1.getFullYear();
      var d=new Date(Date.parse('today'));
      var date2=d.getMonth()+1 +"/"+ d.getDate() +"/"+ d.getFullYear();
      var dateselected1=date1+"-"+date2;
      var presetFromDate = getPresetFilters("fromDate");
      var presetToDate = getPresetFilters("toDate");
      var presetDateOption = getPresetFilters("dateOption");
      if(sessionStorage.getItem("onloadDate") == null || sessionStorage.getItem("onloadDate") == undefined || sessionStorage.getItem("onloadDate") == "")
      {
          dateOption = "DateRange";
          $('#dateRange').val(dateselected1);
          sessionStorage.setItem("onloadDate","true");
          console.log("gluing"  + dateselected1);
          applyFiltersOnLoad();
  
          console.log("filter data with date"+sessionStorage.getItem("filterData"));
      }
      else{
          $('#dateRange').value = dateselected1;
  
      }
  
  }
  </code></pre>
  
  <p>please help me finding the bug.</p>