title: Check if dates in an array are within a date range in JavaScript
body: <p>Firstly, I have a var that contains a date (just one for the moment):</p>
  
  <pre><code>var disableddates = ["26-05-2018"];
  </code></pre>
  
  <p>Now I want to check if this date is in a certain date range. The starting date and ending date are coming form a datepicker (with jQuery calendar plugin). These dates are processed like this:</p>
  
  <p>Arrival date:</p>
  
  <pre><code>//Get arrival date from datepicker
  function aankomstdatumInput() {
      aankomstDatum = document.getElementById("aankomstdatum").value;
      document.getElementById("aankomst").innerHTML = aankomstDatum;
      var parts = aankomstDatum.split('-');
      aankomstDatumDate = new Date(parts[2],parts2[1]-1,parts2[0]);
  }
  </code></pre>
  
  <p>Departure date:</p>
  
  <pre><code>//Get departure date from datepicker
  function vertrekdatumInput() {
      vertrekDatum = document.getElementById("vertrekdatum").value;
      document.getElementById("vertrek").innerHTML = vertrekDatum;
      var parts2 = vertrekDatum.split('-');
      vertrekDatumDate = new Date(parts2[2],parts2[1]-1,parts2[0]);
  }
  </code></pre>
  
  <p>Now I need a function that checks every date in the disableddates array if it's in the range of aankomstDatumDate and vertrekDatumDate.</p>
  
  <p>Since these two dates are formulated in the following way: Sat May 05 2018 00:00:00 GMT+0200 (Romance Daylight Time), I first have to set the disabled date in the same formulation, so I started the function like this:</p>
  
  <pre><code>function checkDisabledDate{
  var parts3 = disableddates.split('-');
  disabledDatumDate = new Date(parts3[2],parts3[1]-1,parts3[0]);
  }
  </code></pre>
  
  <p>I think that's a good first step, but then I'm stuck at how I can check if disabledDatumDate is between aankomstDatumDate and vertrekDatumDate and then start and else/if depending if the disabled date is in between the arrival date and departure date or not.</p>