diff --git a/lib/date.js b/lib/date.js index 63bad45e..da071128 100644 --- a/lib/date.js +++ b/lib/date.js @@ -136,6 +136,10 @@ export function getDateArray(data, startDate, endDate, unit) { } export function getDateLength(startDate, endDate, unit) { + if (!unit) { + unit = 'day'; + } + const [diff] = dateFuncs[unit]; return diff(endDate, startDate) + 1; }