Javascript Date addYears(numberOfYears)

Description

Javascript Date addYears(numberOfYears)


Date.prototype.addYears = function (numberOfYears) {
    var year = this.getFullYear();
    year += parseInt(numberOfYears);
    this.setFullYear(year);// w ww . j  ava 2s. c o m
}



PreviousNext

Related