Skip to content

Commit

Permalink
fix: fix duration format function (#1894)
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou authored Jun 8, 2024
1 parent cec28d0 commit cf722ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/panels/Status/PrintstatusPrinting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ export default class StatusPanelPrintstatusPrinting extends Mixins(BaseMixin) {
}
formatDuration(seconds: number) {
let prefix = seconds < 0 ? '-' : ''
const prefix = seconds < 0 ? '-' : ''
let absSeconds = Math.abs(seconds)
let h = Math.floor(absSeconds / 3600)
const h = Math.floor(absSeconds / 3600)
absSeconds %= 3600
let m = ('0' + Math.floor(absSeconds / 60)).slice(-2)
let s = ('0' + (absSeconds % 60).toFixed(0)).slice(-2)
const m = ('0' + Math.floor(absSeconds / 60)).slice(-2)
const s = ('0' + Math.floor(absSeconds % 60)).slice(-2)
return prefix + h + ':' + m + ':' + s
}
Expand Down

0 comments on commit cf722ea

Please sign in to comment.