mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 21:57:16 +01:00
Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # src/app/share/[...shareId]/Header.tsx
This commit is contained in:
commit
dfc6161a53
5 changed files with 23 additions and 19 deletions
|
|
@ -325,7 +325,7 @@ export function formatDate(
|
|||
}
|
||||
|
||||
export function generateTimeSeries(
|
||||
data: { x: string; y: number }[],
|
||||
data: { x: string; y: number; d?: string }[],
|
||||
minDate: Date,
|
||||
maxDate: Date,
|
||||
unit: string,
|
||||
|
|
@ -345,12 +345,12 @@ export function generateTimeSeries(
|
|||
current = add(current, 1);
|
||||
}
|
||||
|
||||
const lookup = new Map(data.map(({ x, y }) => [formatDate(x, fmt, locale), { x, y }]));
|
||||
const lookup = new Map(data.map(({ x, y, d }) => [formatDate(x, fmt, locale), { x, y, d }]));
|
||||
|
||||
return timeseries.map(t => {
|
||||
const { x, y } = lookup.get(t) || {};
|
||||
const { x, y, d } = lookup.get(t) || {};
|
||||
|
||||
return { x: t, d: x, y: y ?? null };
|
||||
return { x: t, d: d ?? x, y: y ?? null };
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue