This is an automated email from the ASF dual-hosted git repository. kaxilnaik pushed a commit to branch v3-0-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit a7e74d33fc4f812aee446a5211a3fe24878207c6 Author: Brent Bovenzi <[email protected]> AuthorDate: Thu May 1 18:32:26 2025 -0400 Fix duration charts (#50094) (cherry picked from commit c034275bc41606bbeeba3fe123f87ca2c9196642) --- airflow-core/src/airflow/ui/src/components/DurationChart.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/airflow-core/src/airflow/ui/src/components/DurationChart.tsx b/airflow-core/src/airflow/ui/src/components/DurationChart.tsx index 4e525c55e41..6a4e86ff1bd 100644 --- a/airflow-core/src/airflow/ui/src/components/DurationChart.tsx +++ b/airflow-core/src/airflow/ui/src/components/DurationChart.tsx @@ -34,7 +34,7 @@ import { Bar } from "react-chartjs-2"; import type { TaskInstanceResponse, DAGRunResponse } from "openapi/requests/types.gen"; import { system } from "src/theme"; -import { pluralize, getDuration } from "src/utils"; +import { pluralize } from "src/utils"; ChartJS.register( CategoryScale, @@ -55,6 +55,8 @@ const average = (ctx: PartialEventContext, index: number) => { type RunResponse = DAGRunResponse | TaskInstanceResponse; +const getDuration = (start: string, end: string | null) => dayjs.duration(dayjs(end).diff(start)).asSeconds(); + export const DurationChart = ({ entries, kind,
