Renamed and changed convertToMins function to work with larger values
This commit is contained in:
parent
3340fb93df
commit
21026816fe
4 changed files with 24 additions and 10 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue