title: Loop from startdate to enddate from inputs with javascript
body: <p>I've got a startdate and enddate from inputs. And I need to put all the dates from the startdate until the enddate into the database. Therefore I need to make a loop like this: </p>
  
  <pre><code>FOR i = startdate; i &lt;= enddate; i + 1 day 
  {
     here i use the date
  }
  </code></pre>
  
  <p>How do I make such a loop with dates from input boxes? </p>
  
  <p>I get 'invalid date' if I try to do this:</p>
  
  <pre><code>var endDate = new Date($("#enddate").val());
  </code></pre>
  
  <p>And I can't use the endDate.getTime() like I need as you said in the answer, if I do it like this. </p>
  
  <pre><code>var endDate = $("#enddate").val());
  var endDateTime = endDate.getTime();
  </code></pre>
  
  <p><strong>So basically:</strong> How can I convert the input to a date? The input of enddate is like this: dd/mm/yyyy.</p>
  
  <p>No it's not an SQL question, I need to do this is javascript because I need to check the dates first.</p>
  
  <p>Thank you for helping me out ;)</p>