浏览代码

fix: workflow log duration (#1246)

Ahmad Kholid 1 年之前
父节点
当前提交
a11af70e74
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/utils/helper.js

+ 2 - 2
src/utils/helper.js

@@ -211,8 +211,8 @@ export function fileSaver(filename, data) {
 
 
 export function countDuration(started, ended) {
 export function countDuration(started, ended) {
   const duration = Math.round((ended - started) / 1000);
   const duration = Math.round((ended - started) / 1000);
-  const minutes = parseInt((duration / 60) % 60, 10);
-  const seconds = parseInt(duration % 60, 10);
+  const minutes = Math.floor(duration / 60);
+  const seconds = Math.floor(duration % 60);
 
 
   const getText = (num, suffix) => (num > 0 ? `${num}${suffix}` : '');
   const getText = (num, suffix) => (num > 0 ? `${num}${suffix}` : '');