Nodejs Month Add addMonth()

Here you can find the source of addMonth()

Method Source Code

Date.prototype.addMonth = function(){
   this.setMonth(this.getMonth() + 1);//from   ww w  . j  av  a 2  s .  co  m
};

Related

  1. addMonth()
    Date.prototype.addMonth = function () {
      var date = new Date(this.valueOf());
      date.setMonth(date.getMonth() + 1);
      return date;
    };
    
  2. addMonth()
    Date.prototype.addMonth = function addMonth () {
      this.setDate(1);
      this.setHours(0);
      this.setMinutes(0);
      this.setSeconds(0);
      this.setMonth(this.getMonth() + 1);
    };
    
  3. addMonths(m)
    Date.prototype.addMonths = function(m) {
      var d = this.getDate();
      this.setMonth(this.getMonth() + m);
      if (this.getDate() < d)
        this.setDate(0);
    };
    
  4. addMonths(months)
    Date.prototype.addMonths = function(months){
      return new Date(this.getTime() + months*this.getDaysInMonthOfYear()*24*60*60*1000);