SyntaxFix
Write A Post
Hire A Developer
Questions
your startDate is first-day-of-month, In this case we can use
var endDate = moment(startDate).add(1, 'months').subtract(1, 'days');
Hope this helps!!