title: JavaScript date range between date range
body: <p>I'm trying to have an IF check to see if X date range is between Y date range. But it's not returning the correct true/false on the correct time:</p>
  
  <pre><code>var startdate = new Date('06/06/2013');
  var enddate = new Date('06/25/2013');
  var startD = new Date('06/08/2013');
  var endD = new Date('06/18/2013');
  
  if(startD &gt;= startdate || endD &lt;= enddate) {
    return true;
  } else {
    return false;
  }
  </code></pre>
  
  <p>This works, but if I change <code>startdate</code> to <code>06/09/2013</code> and <code>enddate</code> to <code>06/17/2013</code> it no longer works while it should work.</p>
  
  <p>It should even work if <code>startdate</code> was <code>06/07/2013</code> and <code>enddate</code> was <code>06/15/2013</code>, but doesn't. Any thoughts?</p>