mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
fix a new site init, unit maybe undefined
This commit is contained in:
parent
dadb58b91d
commit
7f22ee3934
1 changed files with 4 additions and 0 deletions
|
|
@ -136,6 +136,10 @@ export function getDateArray(data, startDate, endDate, unit) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDateLength(startDate, endDate, unit) {
|
export function getDateLength(startDate, endDate, unit) {
|
||||||
|
if (!unit) {
|
||||||
|
unit = 'day';
|
||||||
|
}
|
||||||
|
|
||||||
const [diff] = dateFuncs[unit];
|
const [diff] = dateFuncs[unit];
|
||||||
return diff(endDate, startDate) + 1;
|
return diff(endDate, startDate) + 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue