lots of changes to switch to vue

This commit is contained in:
Zutatensuppe 2021-05-13 22:45:55 +02:00
parent 5adb8806dc
commit a0118b0bdf
22 changed files with 582 additions and 920 deletions

View file

@ -17,22 +17,23 @@ export const timestamp = () => {
)
}
export const timeDiffStr = (from, to) => {
let diff = to - from
const d = Math.floor(diff / DAY)
diff = diff % DAY
export const durationStr = (duration) => {
const d = Math.floor(duration / DAY)
duration = duration % DAY
const h = Math.floor(diff / HOUR)
diff = diff % HOUR
const h = Math.floor(duration / HOUR)
duration = duration % HOUR
const m = Math.floor(diff / MIN)
diff = diff % MIN
const m = Math.floor(duration / MIN)
duration = duration % MIN
const s = Math.floor(diff / SEC)
const s = Math.floor(duration / SEC)
return `${d}d ${h}h ${m}m ${s}s`
}
export const timeDiffStr = (from, to) => durationStr(to - from)
export default {
MS,
SEC,
@ -42,4 +43,5 @@ export default {
timestamp,
timeDiffStr,
durationStr,
}