diff --git a/DSL/Resql/analytics/POST/chat-quality-overview.sql b/DSL/Resql/analytics/POST/chat-quality-overview.sql index d8f06e9b..538ff5d0 100644 --- a/DSL/Resql/analytics/POST/chat-quality-overview.sql +++ b/DSL/Resql/analytics/POST/chat-quality-overview.sql @@ -6,7 +6,7 @@ WITH latest_per_base AS ( ORDER BY c.base_id, c.updated DESC ) SELECT - DATE_TRUNC(:period, lp.ended) AS time, + DATE_TRUNC(:period, lp.ended AT TIME ZONE :timezone) AT TIME ZONE :timezone AS time, COUNT(DISTINCT lp.base_id) AS total, COUNT(DISTINCT cm_theme.chat_base_id) AS themes, COUNT(DISTINCT cm_quality.chat_base_id) AS response_quality, diff --git a/DSL/Ruuter/analytics/POST/chats/quality-overview.yml b/DSL/Ruuter/analytics/POST/chats/quality-overview.yml index 333f7d47..209fa3f4 100644 --- a/DSL/Ruuter/analytics/POST/chats/quality-overview.yml +++ b/DSL/Ruuter/analytics/POST/chats/quality-overview.yml @@ -23,6 +23,9 @@ declaration: - field: showTest type: boolean description: "Body field 'showTest'" + - field: timezone + type: string + description: "Body field 'timezone'" check_for_required_parameters: switch: @@ -40,6 +43,7 @@ post_chart_data: period: ${incoming.body.period} urls: ${incoming.body.urls} showTest: ${incoming.body.showTest} + timezone: ${incoming.body.timezone} result: chart_result assign_chart_data: diff --git a/GUI/src/pages/ChatsPage/index.tsx b/GUI/src/pages/ChatsPage/index.tsx index addd5f4d..3b5570e1 100644 --- a/GUI/src/pages/ChatsPage/index.tsx +++ b/GUI/src/pages/ChatsPage/index.tsx @@ -338,7 +338,7 @@ const ChatsPage: React.FC = () => { let result: ChartData = { chartData: [], colors: [] }; try { const response = await request< - Readonly<{ start_date: string; end_date: string; period: string; urls: (string | null)[]; showTest: boolean }>, + Readonly<{ start_date: string; end_date: string; period: string; urls: (string | null)[]; showTest: boolean; timezone: string }>, { response: [ { time: string; total: number; themes: number; responseQuality: number; followUp: number }[], @@ -361,6 +361,7 @@ const ChatsPage: React.FC = () => { period: config.groupByPeriod || 'day', urls: getDomainsArray(), showTest: getShowTestData(), + timezone: Intl.DateTimeFormat().resolvedOptions().timeZone, }, }); const chartRows = response.response[0] ?? [];