Javascript Date addDays(daysToAdd)

Description

Javascript Date addDays(daysToAdd)



Date.prototype.addDays = function(daysToAdd){
    if(isNaN(daysToAdd)){
        throw new Error("daysToAdd must be an integer!");
    }/*ww w . ja v  a 2  s  . c  om*/

    return new Date().setDate(this.getDate() + daysToAdd);
};



PreviousNext

Related