Browse Source

fixed broken function

main
deicidus 2 years ago
parent
commit
620f97f483
  1. 8
      util.js

8
util.js

@ -20,10 +20,10 @@ export const noop = () => {}
export const delay = (n = 550) => new Promise(resolve => setTimeout(resolve, n)) export const delay = (n = 550) => new Promise(resolve => setTimeout(resolve, n))
export const isObject = obj => Object.prototype.toString.call(obj) === '[object Object]' export const isObject = obj => { return Object.prototype.toString.call(obj) === '[object Object]' }
export const convertToDuration = (milliseconds: number) => { export const convertToDuration = (milliseconds) => {
const stringifyTime = (time: number): string => String(time).padStart(2, '0') const stringifyTime = (time) => String(time).padStart(2, '0')
const seconds = Math.floor(milliseconds / 1000) const seconds = Math.floor(milliseconds / 1000)
const minutes = Math.floor(seconds / 60) const minutes = Math.floor(seconds / 60)
const hours = Math.floor(minutes / 60) const hours = Math.floor(minutes / 60)
@ -32,7 +32,7 @@ export const convertToDuration = (milliseconds: number) => {
)}:${stringifyTime(seconds % 60)}` )}:${stringifyTime(seconds % 60)}`
} }
export const convertToTimeWorked = (milliseconds: number) => { export const convertToTimeWorked = (milliseconds) => {
const seconds = Math.floor(milliseconds / 1000) const seconds = Math.floor(milliseconds / 1000)
const minutes = Math.floor(seconds / 60) const minutes = Math.floor(seconds / 60)
const hours = Math.floor(minutes / 60) const hours = Math.floor(minutes / 60)

Loading…
Cancel
Save