mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Fixed realtime chart for relational. Removed getDateArray. Added chart min/max dates.
This commit is contained in:
parent
9311f0a183
commit
647dcb5f25
7 changed files with 46 additions and 46 deletions
|
|
@ -273,19 +273,6 @@ export function getMinimumUnit(startDate: number | Date, endDate: number | Date)
|
|||
return 'year';
|
||||
}
|
||||
|
||||
export function getDateFromString(str: string) {
|
||||
const [ymd, hms] = str.split(' ');
|
||||
const [year, month, day] = ymd.split('-');
|
||||
|
||||
if (hms) {
|
||||
const [hour, min, sec] = hms.split(':');
|
||||
|
||||
return new Date(+year, +month - 1, +day, +hour, +min, +sec);
|
||||
}
|
||||
|
||||
return new Date(+year, +month - 1, +day);
|
||||
}
|
||||
|
||||
export function getDateArray(data: any[], startDate: Date, endDate: Date, unit: string) {
|
||||
const arr = [];
|
||||
const { diff, add, start } = DATE_FUNCTIONS[unit];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue