From 41b5dbdf854654f00d5821a932c6b34fbf2eeaeb Mon Sep 17 00:00:00 2001 From: pluja <64632615+pluja@users.noreply.github.com> Date: Tue, 30 Jan 2024 19:35:03 +0100 Subject: [PATCH] Fix #81 --- frontend/src/lib/utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/utils.js b/frontend/src/lib/utils.js index a039cc2..3c3e117 100644 --- a/frontend/src/lib/utils.js +++ b/frontend/src/lib/utils.js @@ -102,13 +102,13 @@ export const downloadVTT = function (jsonData, title) { jsonData.forEach((segment, index) => { let startSeconds = Math.floor(segment.start); let startMillis = Math.floor((segment.start - startSeconds) * 1000); - let start = new Date(startSeconds * 1000 + startMillis).toISOString().substr(11, 12).replace('.', ','); + let start = new Date(startSeconds * 1000 + startMillis).toISOString().substr(11, 12); let endSeconds = Math.floor(segment.end); let endMillis = Math.floor((segment.end - endSeconds) * 1000); - let end = new Date(endSeconds * 1000 + endMillis).toISOString().substr(11, 12).replace('.', ','); + let end = new Date(endSeconds * 1000 + endMillis).toISOString().substr(11, 12); - vttContent += `${index + 1}\n${start} --> ${end}\n- ${segment.text}\n\n`; + vttContent += `${index + 1}\n${start} --> ${end}\n${segment.text}\n\n`; }); let vttBlob = new Blob([vttContent], {type: 'text/plain'}); @@ -118,4 +118,4 @@ export const downloadVTT = function (jsonData, title) { link.download = `${title}.vtt`; link.click(); } - \ No newline at end of file +