Skip to content

Commit

Permalink
Use moment js for better duration display fmt. Fixes #1187 (#1188)
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb authored Sep 26, 2018
1 parent e11abd4 commit e295bcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/visualizers/widgets/ExecutionIndex/ExecutionIndexWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
define([
'deepforge/viz/Utils',
'widgets/LineGraph/LineGraphWidget',
'./lib/moment.min',
'text!./ExecTable.html',
'css!./styles/ExecutionIndexWidget.css'
], function (
Utils,
LineGraphWidget,
moment,
TableHtml
) {
'use strict';
Expand Down Expand Up @@ -173,17 +175,7 @@ define([
};

ExecutionIndexWidget.prototype.getDurationText = function (duration) {
var hours,
min,
sec;

sec = duration/1000;
hours = Math.floor(sec/3600);
sec = sec%3600;
min = Math.floor(sec/60);
sec = Math.floor(sec%60);

return `${hours}:${min}:${sec}`;
return moment.duration(duration).humanize();
};

ExecutionIndexWidget.prototype.updateTime = function (id, force) {
Expand Down
Loading

0 comments on commit e295bcf

Please sign in to comment.