title: Javascript month difference
body: <p>How do I calculate difference in months in Javascript?</p>
  
  <p>Please note there are similar questions such as:
  <a href="https://stackoverflow.com/questions/327429/whats-the-best-way-to-calculate-date-difference-in-javascript">What&#39;s the best way to calculate date difference in Javascript</a></p>
  
  <p>But these are based around MS difference, when some months have different number of days than others!</p>
  
  <p>Any easy way to calculate month difference between 2 dates?</p>
  
  <p>Just to be clear, I need to know how many months the dates span, for example:</p>
  
  <pre><code>Jan 29th 2010, and Feb 1st 2010 = 2 months
  Jan 1st 2010, and Jan 2nd 2010 = 1 month
  Feb 14th 2010, Feb 1st 2011 = 13 months
  Feb 1st 2010, March 30th 2011 = 14 months
  </code></pre>