Renamed and changed convertToMins function to work with larger values

This commit is contained in:
Core 2022-02-07 19:23:22 +00:00
parent 3340fb93df
commit 21026816fe
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6
4 changed files with 24 additions and 10 deletions

View file

@ -1242,10 +1242,24 @@ const app = new Vue({
return this.playerLCD.playbackDuration
}
},
convertToMins(time) {
let mins = Math.floor(time / 60)
let seconds = (Math.floor(time % 60) / 100).toFixed(2)
return `${mins}:${seconds.replace("0.", "")}`
convertTime(time) {
if (typeof time !== "number") {
time = parseInt(time)
}
const timeGates = {
600: 15,
3600: 14,
36000: 12,
}
for (let key in timeGates) {
if (time < key) {
return new Date(time * 1000).toISOString().substring(timeGates[key], 19)
}
}
return new Date(time * 1000).toISOString().substring(11, 19)
},
hashCode(str) {
let hash = 0,