title: Percentage between two dates compared to today
body: <p>I am creating a UI which will contain Milestones and I will be using a progress bar to show this.</p>
  
  <p>I am trying to come up with the percentage we are from the date the milestone is set to be completed vs today's date. </p>
  
  <p>For example if I have a milestone called "Live to Site" that is set to happen on December 1, 2015, and I put the milestone in on Jan 1st, I want to determine the percentage we are from the start date to the end date.</p>
  
  <p>Fiddle: <a href="http://jsfiddle.net/zz4c16fx/2/" rel="noreferrer">http://jsfiddle.net/zz4c16fx/2/</a> </p>
  
  <pre><code>var start = new Date(2015,0,1), // Jan 1, 2015 - The date we put this milestone in
      end = new Date(2015,7,24), // June 24, 2015 - The date the milestone is due
      today = new Date(), // April 23, 2015
      p = Math.round(100-((end - start) * 100 ) / today) + '%';
  
  // Update the progress bar
  $('.bar').css( "width", p ).after().append(p);
  </code></pre>
  
  <p>That was my attempt at it but either my math is wrong or I am thinking about this incorrectly. The number its returning is <code>99%</code>. I feel that number should be lower seeing how we have 1.5 months left from today.</p>
  
  <p>My end result is to show a progress bar that show how close we are to the completion date given the start, end and today's date.</p>