title: Comparing Datepicker Dates Javascript
body: <p>I'm trying to compare two <code>datepicker</code> dates and see if they are more than 7 days apart. </p>
  
  <p>How would I do this? </p>
  
  <p>I would normally just see if their difference is greater than 7, but that won't account for months and such.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>var datepickerBegin = $("#datepicker_start").val();
  var datepickerEnd = $("#datepicker_to").val();
  
  if (datepickerBegin - datepickerEnd &gt; 7) { 
      alert('more than a week apart!') 
  }
  </code></pre>
  
  <p>Any tips?? </p>