range = {
const today = new Date();
const year = today.getFullYear();
const thisMonth = today.getMonth();
const lastMonth = (thisMonth - 1) % 12;
const lastStart = new Date(year, lastMonth, 1);
const thisStart = new Date(year, thisMonth, 1);
const lastEnd = new Date(thisStart.setDate(thisStart.getDate() - 1));
const dateFormat = d3.timeFormat("%Y-%m-%dT%H:%M:%S.%L")
return {
start: dateFormat(lastStart),
end: dateFormat(lastEnd)
}
}