How to list all month between 2 dates with moment.js?

This should do it:

var dateStart = moment('2013-8-31');
var dateEnd = moment('2015-3-30');
var timeValues = [];

while (dateEnd > dateStart || dateStart.format('M') === dateEnd.format('M')) {
   timeValues.push(dateStart.format('YYYY-MM'));
   dateStart.add(1,'month');
}

I think the original answer isn't entirely correct, as you wouldn't get '2015-3' in your array. This is due to the fact your start date would eventually end up as '2015-3-31' and would fail the conditional in place. You could extend it like below.

UPDATE: I've now included cloning the dateStart variable so it isn't mutated at all.

var dateStart = moment('2013-8-31');
var dateEnd = moment('2015-3-30');
var interim = dateStart.clone();
var timeValues = [];

while (dateEnd > interim || interim.format('M') === dateEnd.format('M')) {
   timeValues.push(interim.format('YYYY-MM'));
   interim.add(1,'month');
}