Using the moment.js library:
function getDates(startDate, stopDate) {
var dateArray = [];
var currentDate = moment(startDate);
var stopDate = moment(stopDate);
while (currentDate <= stopDate) {
dateArray.push( moment(currentDate).format('YYYY-MM-DD') )
currentDate = moment(currentDate).add(1, 'days');
}
return dateArray;
}
Remember to change the format
to use according to your date format.
If you can't (or don't want to) use the momentjs library, you can do something like:
var start = new Date("Wed Jun 01 2016 00:00:00"),
end = new Date("Sat Apr 01 2017 00:00:00"),
currentDate = new Date(start.getTime()),
between = [];
while (currentDate <= end) {
between.push(new Date(currentDate));
currentDate.setDate(currentDate.getDate() + 1);
}