Skip to content

Commit

Permalink
webdash: fixed elapsedTime calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstruck committed Mar 23, 2018
1 parent 9aae6ad commit 6bac6bb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
16 changes: 9 additions & 7 deletions webdash/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ function formatElapsedTime(miliseconds) {
}

function elapsedTime(task) {
if (task.logs[0].start_time) {
now = new Date();
if (task.logs[0].end_time) {
now = Date.parse(task.logs[0].end_time);
if (task.logs && task.logs.length) {
if (task.logs[0].start_time) {
now = new Date();
if (task.logs[0].end_time) {
now = Date.parse(task.logs[0].end_time);
}
started = Date.parse(task.logs[0].start_time);
elapsed = now - started;
return formatElapsedTime(elapsed);
}
started = Date.parse(task.logs[0].start_time);
elapsed = now - started;
return formatElapsedTime(elapsed);
}
return "--";
}
Expand Down
24 changes: 12 additions & 12 deletions webdash/web.go

Large diffs are not rendered by default.

0 comments on commit 6bac6bb

Please sign in to comment.