mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
fix compare screens
This commit is contained in:
parent
f70f98fed0
commit
4d06b0ca5b
3 changed files with 12 additions and 17 deletions
|
|
@ -289,13 +289,13 @@ export function minDate(...args: any[]) {
|
|||
|
||||
export function getCompareDate(compare: string, startDate: Date, endDate: Date) {
|
||||
if (compare === 'yoy') {
|
||||
return { startDate: subYears(startDate, 1), endDate: subYears(endDate, 1) };
|
||||
return { compare, startDate: subYears(startDate, 1), endDate: subYears(endDate, 1) };
|
||||
}
|
||||
|
||||
if (compare === 'prev') {
|
||||
const diff = differenceInMinutes(endDate, startDate);
|
||||
|
||||
return { startDate: subMinutes(startDate, diff), endDate: subMinutes(endDate, diff) };
|
||||
return { compare, startDate: subMinutes(startDate, diff), endDate: subMinutes(endDate, diff) };
|
||||
}
|
||||
|
||||
return {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue