|
|
|
@ -20,10 +20,10 @@ export const noop = () => {}
|
|
|
|
|
|
|
|
|
|
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) => { |
|
|
|
|
const stringifyTime = (time: number): string => String(time).padStart(2, '0') |
|
|
|
|
export const convertToDuration = (milliseconds) => { |
|
|
|
|
const stringifyTime = (time) => String(time).padStart(2, '0') |
|
|
|
|
const seconds = Math.floor(milliseconds / 1000) |
|
|
|
|
const minutes = Math.floor(seconds / 60) |
|
|
|
|
const hours = Math.floor(minutes / 60) |
|
|
|
@ -32,7 +32,7 @@ export const convertToDuration = (milliseconds: number) => {
|
|
|
|
|
)}:${stringifyTime(seconds % 60)}` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const convertToTimeWorked = (milliseconds: number) => { |
|
|
|
|
export const convertToTimeWorked = (milliseconds) => { |
|
|
|
|
const seconds = Math.floor(milliseconds / 1000) |
|
|
|
|
const minutes = Math.floor(seconds / 60) |
|
|
|
|
const hours = Math.floor(minutes / 60) |
|
|
|
|