Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

fix inconsistent date format

Indra Gunawan14012ed68e66
diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts
index bfd007d1b..cbabe03b1 100644
--- a/src/lib/prisma.ts
+++ b/src/lib/prisma.ts
@@ -20,14 +20,6 @@ const PRISMA_LOG_OPTIONS = {
};
const DATE_FORMATS = {
- minute: 'YYYY-MM-DD HH24:MI:00',
- hour: 'YYYY-MM-DD HH24:00:00',
- day: 'YYYY-MM-DD HH24:00:00',
- month: 'YYYY-MM-01 HH24:00:00',
- year: 'YYYY-01-01 HH24:00:00',
-};
-
-const DATE_FORMATS_UTC = {
minute: 'YYYY-MM-DD"T"HH24:MI:00"Z"',
hour: 'YYYY-MM-DD"T"HH24:00:00"Z"',
day: 'YYYY-MM-DD"T"HH24:00:00"Z"',
@@ -52,7 +44,7 @@ function getDateSQL(field: string, unit: string, timezone?: string): string {
return `to_char(date_trunc('${unit}', ${field} at time zone '${timezone}'), '${DATE_FORMATS[unit]}')`;
}
- return `to_char(date_trunc('${unit}', ${field}), '${DATE_FORMATS_UTC[unit]}')`;
+ return `to_char(date_trunc('${unit}', ${field}), '${DATE_FORMATS[unit]}')`;
}
function getDateWeeklySQL(field: string, timezone?: string) {