Refactor BarChart component.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user