Refactor BarChart component.

This commit is contained in:
Mike Cao committed 2020-08-27 19:11:37 -07:00
1 parent 4618dc7f15
commit d936ecc86e
3 files changed
+73 -63

No files matched your search

+5
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;
}