I need to calculate a JS date given year=2014 and month=9 (September 2014).
I tried this:
var moment = require(\'moment\'); var startDate = moment( y
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!!