From f52c9e5e5dba9bb3e481c39266526e2a2b111d85 Mon Sep 17 00:00:00 2001 From: ashrafchowdury Date: Mon, 11 Nov 2024 17:28:19 +0600 Subject: [PATCH 1/3] fix(frontend): observability windowing time zone issue --- agenta-web/src/components/Filters/Sort.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/agenta-web/src/components/Filters/Sort.tsx b/agenta-web/src/components/Filters/Sort.tsx index 46d0da3b6e..a9b35be3f7 100644 --- a/agenta-web/src/components/Filters/Sort.tsx +++ b/agenta-web/src/components/Filters/Sort.tsx @@ -99,10 +99,18 @@ const Sort: React.FC = ({onSortApply, defaultSortValue}) => { .toISOString() .split(".")[0] } else if (sortData === "custom" && (customRange?.startTime || customRange?.endTime)) { - if (customRange.startTime) - customRangeTime.startTime = customRange.startTime.toISOString().split(".")[0] - if (customRange.endTime) - customRangeTime.endTime = customRange.endTime.toISOString().split(".")[0] + if (customRange.startTime) { + customRangeTime.startTime = dayjs(customRange.startTime) + .utc() + .toISOString() + .split(".")[0] + } + if (customRange.endTime) { + customRangeTime.endTime = dayjs(customRange.endTime) + .utc() + .toISOString() + .split(".")[0] + } } else if (sortData === "all time") { sortedTime = "1970-01-01T00:00:00" } From d6e7a1729f95b22cc94a3fe0c48543781e1ae45b Mon Sep 17 00:00:00 2001 From: ashrafchowdury Date: Mon, 11 Nov 2024 17:43:55 +0600 Subject: [PATCH 2/3] fix(frontend): converted utc to local time zone before diplaying to user --- .../components/pages/observability/ObservabilityDashboard.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agenta-web/src/components/pages/observability/ObservabilityDashboard.tsx b/agenta-web/src/components/pages/observability/ObservabilityDashboard.tsx index cf5a804c0d..f1c6c75d5a 100644 --- a/agenta-web/src/components/pages/observability/ObservabilityDashboard.tsx +++ b/agenta-web/src/components/pages/observability/ObservabilityDashboard.tsx @@ -213,7 +213,9 @@ const ObservabilityDashboard = () => { }), render: (_, record) => { return ( -
{dayjs(record.lifecycle?.created_at).format("HH:mm:ss DD MMM YYYY")}
+
+ {dayjs(record.lifecycle?.created_at).local().format("HH:mm:ss DD MMM YYYY")} +
) }, }, From e1e2c9f74014fd880885741efeb5dbc146be1ec6 Mon Sep 17 00:00:00 2001 From: ashrafchowdury Date: Mon, 11 Nov 2024 17:59:56 +0600 Subject: [PATCH 3/3] fix(frontend): trace drawer timezone format --- .../pages/observability/drawer/TraceContent.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/agenta-web/src/components/pages/observability/drawer/TraceContent.tsx b/agenta-web/src/components/pages/observability/drawer/TraceContent.tsx index 1b0cd4732f..f0c1387eaf 100644 --- a/agenta-web/src/components/pages/observability/drawer/TraceContent.tsx +++ b/agenta-web/src/components/pages/observability/drawer/TraceContent.tsx @@ -331,9 +331,13 @@ const TraceContent = ({activeTrace}: TraceContentProps) => { - {dayjs(activeTrace.time.start).format("DD/MM/YYYY, hh:mm:ss A")} + {dayjs(activeTrace.time.start) + .local() + .format("DD/MM/YYYY, hh:mm:ss A")} {" "} - {dayjs(activeTrace.time.end).format("DD/MM/YYYY, hh:mm:ss A")} + {dayjs(activeTrace.time.end) + .local() + .format("DD/MM/YYYY, hh:mm:ss A")} } />