title: Moment JS: Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release
body: <p>I'm getting <code>Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.</code>
  But I'm a newbie I cannot figure out how to fix it so the above message disappear.
  I think the problem lies in these two lines but I'm not sure.</p>
  
  <pre><code>var nextMonth = moment(moment(year + "-" + month + "-1")).add(1, "months").format("MM");
  var nextYear  = moment(moment(year + "-" + month + "-1")).add(1, "months").format("YYYY");
  </code></pre>
  
  <p>I have already checked <a href="https://github.com/moment/moment/issues/1407" rel="nofollow noreferrer">https://github.com/moment/moment/issues/1407</a> and <a href="https://stackoverflow.com/questions/23263380/deprecation-warning-moment-construction-falls-back-to-js-date">Deprecation warning: moment construction falls back to js Date</a> but neither seems to work on my problem. </p>
  
  <p>I would like to know where in this calculation I should tell the format to the moment or at least how to make this calculations in the right format so the warning disappears.</p>
  
  <p>Thanks in advance!</p>