Returns the last day in the month that contains the CalculationDate.

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

var endOfMonth = date.endOfMonth();

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

//endOfMonth = 2017-03-31 00:00:00
Did this answer your question?