diff --git a/src/pages/Editor.vue b/src/pages/Editor.vue index 38c033fa..1ee50008 100644 --- a/src/pages/Editor.vue +++ b/src/pages/Editor.vue @@ -1888,16 +1888,23 @@ export default { }, // format a number based timestamp like 24.32 to a string like 00:24:320 + // or a number like 3600.32 to a string like 01:00:320 formatTimestamp(timestamp) { - const minutes = Math.floor(timestamp / 60); + const hours = Math.floor(timestamp / 3600); + const minutes = Math.floor((timestamp % 3600) / 60); const seconds = Math.floor(timestamp % 60); const milliseconds = Math.floor((timestamp % 1) * 1000); + const formattedHours = String(hours).padStart(2, '0'); const formattedMinutes = String(minutes).padStart(2, '0'); const formattedSeconds = String(seconds).padStart(2, '0'); const formattedMilliseconds = String(milliseconds).padStart(3, '0'); - return `${formattedMinutes}:${formattedSeconds}:${formattedMilliseconds}`; + if (hours > 0) { + return `${formattedHours}:${formattedMinutes}:${formattedSeconds}:${formattedMilliseconds}`; + } else { + return `${formattedMinutes}:${formattedSeconds}:${formattedMilliseconds}`; + } }, /**