mirror of https://github.com/rancher/ui.git
20 lines
406 B
JavaScript
20 lines
406 B
JavaScript
import { helper } from '@ember/component/helper';
|
|
|
|
export function runTime(params) {
|
|
var s = moment(params[0]);
|
|
var e = moment(params[1]);
|
|
var time = Math.round(e.diff(s) / 100) / 10;
|
|
|
|
if ( time ) {
|
|
if ( time > 60 ) {
|
|
time = Math.round(time);
|
|
}
|
|
|
|
return `${ time } sec`;
|
|
} else {
|
|
return '<span class="text-muted">-</span>'.htmlSafe();
|
|
}
|
|
}
|
|
|
|
export default helper(runTime);
|