function generateDates(startDate, endDate, isLocal = true) {
const parseTime = d3.timeParse("%Y-%m-%d");
const start = parseTime(startDate);
const end = parseTime(endDate);
const dates = [];
for (let day = start; day <= end; day = d3.timeDay.offset(day, 1)) {
const formattedDate = d3.timeFormat("%Y-%m-%d")(day);
const ts = isLocal
? Date.parse(`${formattedDate} 00:00:00`) / 1000
: Date.parse(`${formattedDate} 00:00:00 UTC`) / 1000;
dates.push({ ts, date: formattedDate });
}
return dates;
}