title: Difference in Days between two Date picker values in JavaScript?
body: <p>I have two datepickers as follows :</p>
  
  <pre><code>&lt;input type="date" name ="datepicker_start" id="datepicker" value=""  class="datepicker" size="20" /&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;input type="date" name ="datepicker_end" id="datepicker2"  value="" class="datepicker" size="20" /&gt;
  </code></pre>
  
  <p>And i want to calculate the difference in days and then compare the difference in days with :</p>
  
  <pre><code>&lt;input type="text" name="tleave" value="Var" readonly="true" size="10" /&gt;
  </code></pre>
  
  <p>where Var is a variable.</p>
  
  <p>then i need to popup an error message if the difference is greater than "Var" value.</p>
  
  <p>Basically consider it as a Leave Request,when you can set the start and end dates for your leave,but the duration of the leave cannot exceed the Leave balance; if it does,system should notify the user.</p>