var range = getDates(new Date(), new Date().addDays(7));
I\'d like \"range\" to be an array of date objects, one for each day between the two dates
d3js provides a lot of handy functions and includes d3.time for easy date manipulations
https://github.com/d3/d3-time
For your specific request:
Utc
var range = d3.utcDay.range(new Date(), d3.utcDay.offset(new Date(), 7));
or local time
var range = d3.timeDay.range(new Date(), d3.timeDay.offset(new Date(), 7));
range will be an array of date objects that fall on the first possible value for each day
you can change timeDay to timeHour, timeMonth etc for the same results on different intervals