mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
Refactor filter handling for queries.
This commit is contained in:
parent
5b300f1ff5
commit
ee6c68d27c
107 changed files with 731 additions and 835 deletions
|
|
@ -292,9 +292,13 @@ export function getCompareDate(compare: string, startDate: Date, endDate: Date)
|
|||
return { startDate: subYears(startDate, 1), endDate: subYears(endDate, 1) };
|
||||
}
|
||||
|
||||
const diff = differenceInMinutes(endDate, startDate);
|
||||
if (compare === 'prev') {
|
||||
const diff = differenceInMinutes(endDate, startDate);
|
||||
|
||||
return { startDate: subMinutes(startDate, diff), endDate: subMinutes(endDate, diff) };
|
||||
return { startDate: subMinutes(startDate, diff), endDate: subMinutes(endDate, diff) };
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
export function getDayOfWeekAsDate(dayOfWeek: number) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue