mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 07:07:17 +01:00
Render UTC dates in sessions.
This commit is contained in:
parent
c79720ae1d
commit
deb9dd60df
10 changed files with 35 additions and 62 deletions
|
|
@ -8,6 +8,7 @@ import { filtersToArray } from './params';
|
|||
import { PageParams, QueryFilters, QueryOptions } from './types';
|
||||
|
||||
export const CLICKHOUSE_DATE_FORMATS = {
|
||||
utc: '%Y-%m-%dT%H:%i:%SZ',
|
||||
second: '%Y-%m-%d %H:%i:%S',
|
||||
minute: '%Y-%m-%d %H:%i:00',
|
||||
hour: '%Y-%m-%d %H:00:00',
|
||||
|
|
@ -47,7 +48,7 @@ function getClient() {
|
|||
return client;
|
||||
}
|
||||
|
||||
function getDateStringSQL(data: any, unit: string | number, timezone?: string) {
|
||||
function getDateStringSQL(data: any, unit: string = 'utc', timezone?: string) {
|
||||
if (timezone) {
|
||||
return `formatDateTime(${data}, '${CLICKHOUSE_DATE_FORMATS[unit]}', '${timezone}')`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue