I have the following date:
2014-10-29
I am trying to add one year to the date (not 365 days, but 1 year):
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]);
This returns 2020-04-06, which is obviously wrong.
What am I doing wrong here?