mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 08:37:13 +01:00
fix chart and timezone issues, pass consistent dates to DB.
Closes #3700
This commit is contained in:
parent
81bedec6d5
commit
6751bf88bb
10 changed files with 157 additions and 79 deletions
|
|
@ -51,12 +51,12 @@ function getUTCString(date?: Date | string | number) {
|
|||
return formatInTimeZone(date || new Date(), 'UTC', 'yyyy-MM-dd HH:mm:ss');
|
||||
}
|
||||
|
||||
function getDateStringSQL(data: any, unit: string = 'utc', timezone?: string) {
|
||||
function getDateStringSQL(field: string, unit: string, timezone?: string) {
|
||||
if (timezone) {
|
||||
return `formatDateTime(${data}, '${CLICKHOUSE_DATE_FORMATS[unit]}', '${timezone}')`;
|
||||
return `formatDateTime(${field}, '${CLICKHOUSE_DATE_FORMATS[unit]}', '${timezone}')`;
|
||||
}
|
||||
|
||||
return `formatDateTime(${data}, '${CLICKHOUSE_DATE_FORMATS[unit]}')`;
|
||||
return `formatDateTime(${field}, '${CLICKHOUSE_DATE_FORMATS[unit]}')`;
|
||||
}
|
||||
|
||||
function getDateSQL(field: string, unit: string, timezone?: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue