title: How to get the months between 2 dates
body: <p>I'm using jquery <code>datepicker</code> in order to get 2 dates. In my case I have to get the date in this format <code>d-M-y</code>. I'm using it in order to be able to insert the values into an <code>oracle</code> database without any formating. The problem is that I need to calculate the months between 2 dates. For example: <code>1-Oct-13</code> - <code>30-Oct-16</code>.</p>
  
  <p>Here is how I'm getting the dates in my js:</p>
  
  <pre><code>LastAssimDatePicker = (function() {
                          $( "#lastAssimilationDate" ).datepicker({
                              yearRange: "-20:+100",
                              changeMonth: true,
                              changeYear: true,
                              dateFormat: "d-M-y"
                          });
                      }),
  
  LastAssimDateOverPicker = (function() {
                          $( "#lastAssimilationDateOver" ).datepicker({
                              yearRange: "-20:+100",
                              changeMonth: true,
                              changeYear: true,
                              dateFormat: "d-M-y"
                          });
                      }),
  </code></pre>
  
  <p>The above dates are assigned to <code>2 variables</code> - <code>lastAssimilationDate</code> and <code>LastAssimDateOver</code></p>
  
  <p>The problem is that I really can't find a way to calculate the months between the 2 dates and I already lost about 2 hours on it. I'm pretty sure that there will be an easy solution, but as a beginner, I'm not able to spot it. I know that there are simmilar topics here, but I can't get it working, or it does not fit on my issue.</p>