Refactor BarChart component.

This commit is contained in:
Mike Cao 2020-08-27 13:46:05 -07:00
parent 4618dc7f15
commit d936ecc86e
3 changed files with 73 additions and 63 deletions

View file

@ -113,3 +113,8 @@ export function getDateArray(data, startDate, endDate, unit) {
return arr;
}
export function getDateLength(startDate, endDate, unit) {
const [diff] = dateFuncs[unit];
return diff(endDate, startDate) + 1;
}