mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Merge branch 'dev' of https://github.com/umami-software/umami into bug/um-200-fix-referrer-filters
This commit is contained in:
commit
790e71cc14
14 changed files with 117 additions and 179 deletions
|
|
@ -181,18 +181,18 @@ export function getDateArray(data, startDate, endDate, unit) {
|
|||
const n = diff(endDate, startDate) + 1;
|
||||
|
||||
function findData(t) {
|
||||
const x = data.find(e => {
|
||||
return normalize(getDateFromString(e.t)).getTime() === t.getTime();
|
||||
const d = data.find(({ x }) => {
|
||||
return normalize(getDateFromString(x)).getTime() === t.getTime();
|
||||
});
|
||||
|
||||
return x?.y || 0;
|
||||
return d?.y || 0;
|
||||
}
|
||||
|
||||
for (let i = 0; i < n; i++) {
|
||||
const t = normalize(add(startDate, i));
|
||||
const y = findData(t);
|
||||
|
||||
arr.push({ ...data[i], t, y });
|
||||
arr.push({ x: t, y });
|
||||
}
|
||||
|
||||
return arr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue