feature(dashboard,api): add timezone support

* feat(dashboard): add support for today, yesterday etc (timezones)

* fix(db): escape js dates

* fix(dashboard): ensure we support default timezone

* final fixes

* remove complete series and add sql with fill instead
This commit is contained in:
Carl-Gerhard Lindesvärd
2025-05-23 11:26:44 +02:00
committed by GitHub
parent 46bfeee131
commit 680727355b
48 changed files with 1817 additions and 758 deletions

View File

@@ -12,6 +12,7 @@ import {
formatClickhouseDate,
getEventList,
getEvents,
getSettingsForProject,
overviewService,
sessionService,
} from '@openpanel/db';
@@ -275,7 +276,8 @@ export const eventRouter = createTRPCRouter({
}),
)
.query(async ({ input }) => {
const { startDate, endDate } = getChartStartEndDate(input);
const { timezone } = await getSettingsForProject(input.projectId);
const { startDate, endDate } = getChartStartEndDate(input, timezone);
if (input.search) {
input.filters.push({
id: 'path',
@@ -292,6 +294,7 @@ export const eventRouter = createTRPCRouter({
interval: input.interval,
cursor: input.cursor || 1,
limit: input.take,
timezone,
});
}),