fix a new site init, unit maybe undefined
parent
dadb58b91d
commit
7f22ee3934
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue