Skip to content

Commit

Permalink
Fix [UI] [Jobs workflow report] Unexpected 'Duration' format in UI (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytro-panchuk authored Jan 2, 2022
1 parent ef4943a commit bdb9c8c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/measureTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export default (startTime, endTime) => {
m = (h - ~~h) * 60
s = (m - ~~m) * 60

const hours = `${~~h}:${~~m}:${~~s}`
const hours = generateTime(~~h, ~~m, ~~s)

return ~~d > 0 ? `${~~d} ${d > 1 ? 'days ' : 'day '}` + hours : hours
}

const generateTime = (...args) => {
return args.map(el => (el < 10 ? '0' + el : el)).join(':')
}

0 comments on commit bdb9c8c

Please sign in to comment.