1var myCurrentDate=new Date();
2var myFutureDate=new Date(myCurrentDate);
3 myFutureDate.setDate(myFutureDate.getDate()+ 8);//myFutureDate is now 8 days in the future
1var newDate = new Date(date.setMonth(date.getMonth()+8));
2
3var jan312009 = new Date(2009, 0, 31);
4var eightMonthsFromJan312009 = jan312009.setMonth(jan312009.getMonth()+8);
5//@SUJAY
1// d - is a moment() call
2addOneMonth: function (d) {
3 let fm = moment(d).add(1, 'M');
4 let fmEnd = moment(fm).endOf('month');
5 return d.date() != fm.date() && fm.isSame(fmEnd.format('YYYY-MM-DD')) ? fm.add(1, 'd') : fm;
6};