Adjust time display

This commit is contained in:
Geomitron
2025-04-11 21:37:20 -04:00
parent 8dab57f0cb
commit 5b9cebad36
2 changed files with 3 additions and 3 deletions

View File

@@ -171,12 +171,12 @@ export function columnNumberToLetter(column: number) {
}
/**
* @returns an string representation of `ms` that looks like HH:MM:SS.mm
* @returns a string representation of `ms` that looks like HH:MM:SS.mm
*/
export function msToExactTime(ms: number) {
const seconds = _.round((ms / 1000) % 60, 2)
const minutes = Math.floor((ms / 1000 / 60) % 60)
const hours = Math.floor((ms / 1000 / 60 / 60) % 24)
const hours = Math.floor(ms / 1000 / 60 / 60)
return `${hours ? `${hours}:` : ''}${_.padStart(
minutes + '',
2,

View File

@@ -140,7 +140,7 @@ export function instrumentToDiff(instrument: Instrument | 'vocals') {
export function msToRoughTime(ms: number) {
const seconds = _.floor((ms / 1000) % 60)
const minutes = _.floor((ms / 1000 / 60) % 60)
const hours = _.floor((ms / 1000 / 60 / 60) % 24)
const hours = _.floor(ms / 1000 / 60 / 60)
return `${hours ? `${hours}:` : ''}${minutes}:${_.padStart(String(seconds), 2, '0')}`
}