Returns a new CalculationDate relative to the CalculationDate on the same day of the month for the month next to the one that contains the CalculationDate. 

var date = now.valueOf('2017-03-15'); 

var nextMonth = date.nextMonth();

console.log('nextMonth = %s', nextMonth);

//nextMonth = 2017-04-15 00:00:00

When the previous month has fewer days and the CurrentDate cannot match the day of the month the date is shifted to always be the end of the previous month. 

var date = now.valueOf('2017-03-31'); 

var nextMonth = date.nextMonth();

console.log('nextMonth = %s', nextMonth);

//nextMonth = 2017-04-30 00:00:00
Did this answer your question?