ashb commented on a change in pull request #8675:
URL: https://github.com/apache/airflow/pull/8675#discussion_r443262258
##########
File path: airflow/www/static/js/task-instances.js
##########
@@ -80,6 +88,17 @@ export default function tiTooltip(ti, {includeTryNumber =
false} = {}) {
} else {
tt += `Started: ${escapeHtml(ti.start_date)}<br>`;
}
+ // Calculate duration on the fly if task instance is still running
+ if(ti.state === "running") {
+ let start_date;
+ if (ti.start_date instanceof moment) {
+ start_date = ti.start_date
+ } else {
+ start_date = moment(ti.start_date)
+ }
Review comment:
```suggestion
let start_date = ti.start_date instanceof moment ? ti.start_date :
moment(ti.start_date);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]