title: Adding 1 Year to a Date with JavaScript
body: <p>I have the following date:</p>
  
  <pre><code>2014-10-29
  </code></pre>
  
  <p>I am trying to add one year to the date (not 365 days, but 1 year):</p>
  
  <pre class="lang-js prettyprint-override"><code>var newDate = new Date('2014-10-29');
  
  newDate.setDate(newDate.getFullYear() + 1);
  
  var yyyy = newDate.getFullYear().toString();
  var mm = (newDate.getMonth() + 1).toString();
  var dd = newDate.getDate().toString();
  
  var mmChars = mm.split('');
  var ddChars = dd.split('');
  var newClosingDate = yyyy + '-' + (mmChars[1] ? mm : "0" + mmChars[0]) + '-' + (ddChars[1] ? dd : "0" + ddChars[0]);
  </code></pre>
  
  <p>This returns <code>2020-04-06</code>, which is obviously wrong.</p>
  
  <p>What am I doing wrong here?</p>