1var currentDate = moment('2015-10-30');
2var futureMonth = moment(currentDate).add(1, 'M');
3var futureMonthEnd = moment(futureMonth).endOf('month');
4
5if(currentDate.date() != futureMonth.date() && futureMonth.isSame(futureMonthEnd.format('YYYY-MM-DD'))) {
6 futureMonth = futureMonth.add(1, 'd');
7}
8
9console.log(currentDate);
10console.log(futureMonth);