mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
follow-up - reverted getDateQuery logic
This commit is contained in:
parent
15ae4569c5
commit
bb1d17a5e2
@ -21,7 +21,7 @@ export function getDateQuery(field, unit, timezone) {
|
||||
if (timezone) {
|
||||
return `to_char(date_trunc('${unit}', ${field} at time zone '${timezone}'), '${POSTGRESQL_DATE_FORMATS[unit]}')`;
|
||||
}
|
||||
return `date_trunc('${unit}', ${field})`;
|
||||
return `to_char(date_trunc('${unit}', ${field}), '${POSTGRESQL_DATE_FORMATS[unit]}')`;
|
||||
}
|
||||
|
||||
if (db === MYSQL) {
|
||||
@ -31,7 +31,7 @@ export function getDateQuery(field, unit, timezone) {
|
||||
return `date_format(convert_tz(${field},'+00:00','${tz}'), '${MYSQL_DATE_FORMATS[unit]}')`;
|
||||
}
|
||||
|
||||
return `${field}`;
|
||||
return `date_format(${field}, '${MYSQL_DATE_FORMATS[unit]}')`;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user