title: Find difference between two dates with javascript
body: <p>I am trying to find the difference between two dates. The dates are got with jquery and I am using datejs too. When using datejs it picks up my date as US thinking it is MM/DD/YYYY instead of dd-mm-yyyy. My result for difference is NaN. How do I work this out. Am I miles out or anywhere near close?</p>
  
  <pre><code>var msMinute = 60*1000, 
      msDay = 60*60*24*1000;
  
  start = $('#reconcile_start_date').val();   // 10-12-2014 | dd-mm-yyyy
  end = $('#reconcile_end_date').val();           // 15-12-2014 | dd-mm-yyyy
  
  start = new Date(start);
  end   = new Date(end);
  
  console.log(Math.floor((end - start) / msDay) + ' full days between ' + end + ' and ' + start);
  difference = Math.floor((end - start) / msDay);
  
  if(difference &gt; 30){}
  </code></pre>