title: Subtract Months with Moment.js Correctly Even After Surpassing February
body: <p>Is there any fix for this or a workaround - even without using Moment.js?</p>
  
  <pre><code>&lt;form id="DateFor," class="row-form" method="post" action=""&gt;
                 &lt;p&gt;
                    &lt;label for="ETL_DATE"&gt;Search by date:&lt;/label&gt;
                    &lt;span&gt;
                      &lt;script&gt;
                      var curr_month_day = moment();
                      var prev6_month_start = moment().subtract(6, 'months').startOf('month');
                      var prev6_month_end = moment().subtract(6, 'months').endOf('month');
                      var Dur_prev6_month_start = moment.duration({ from: curr_month_day, to: prev6_month_start });
                      var Dur_prev6_month_end = moment.duration({ from: curr_month_day, to: prev6_month_end });
                      document.write('&lt;input data-widget="datepicker" data-format="mmm dd, yyyy" type="text" data-min="' +Math.round(Dur_prev6_month_start.asDays())+ '" data-max="' +Math.round(Dur_prev6_month_end.asDays())+ '" data-select-months="false"  data-select-years="false" value="" size="20" id="ETL_DATE" name="ChangeDatePicker"&gt;');
                      &lt;/script&gt;
                    &lt;/span&gt;
                 &lt;/p&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p>This code returns messed up start and end date for Jan 2017 (currently) - 30 Dec 2016 and 29 Jan 2017. It appears to me that the different number of days in Feb is the root cause.</p>
  
  <p>It should calculate properly the number of days to the first and the last day of January 2017.</p>
  
  <p>EDIT:
  I want to confirm that the problem is with '.duration' and '.subtract' of Moment.js.</p>