Javascript Date addDay(day)

Description

Javascript Date addDay(day)


/**/*from w w  w . j  av a2s . c  o m*/
 * calculate date
 * 
 * @param day the target, it can less than zero, but it must be a INTEGER
 * @returns {Date}
 */
Date.prototype.addDay = function(day) {
 if (null == day || isNaN(day)) {
  return this;
 }
 this.setDate(this.getDate() + day);
 return this;
};



PreviousNext

Related