Skip to content

Commit

Permalink
Use current time to calculate duration when end date is not present. (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
tirkarthi authored and utkarsharma2 committed Apr 22, 2024
1 parent caa21ef commit d9a4445
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions airflow/www/static/js/dag/details/dag/RunDurationChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ const RunDurationChart = ({ showLandingTimes }: Props) => {

// @ts-ignore
const runDuration = moment.duration(
dagRun.startDate && dagRun.endDate
? getDuration(dagRun.startDate, dagRun?.endDate)
: 0
dagRun.startDate ? getDuration(dagRun.startDate, dagRun?.endDate) : 0
);

// @ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion airflow/www/static/js/dag/details/task/TaskDuration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const TaskDuration = () => {
if (!instance) return {};
// @ts-ignore
const runDuration = moment.duration(
instance.startDate && instance.endDate
instance.startDate
? getDuration(instance.startDate, instance?.endDate)
: 0
);
Expand Down

0 comments on commit d9a4445

Please sign in to comment.