From 535d23a5d6e31bb771394fcad3f2ec1a73408343 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 26 May 2025 09:54:02 +0200 Subject: [PATCH] Add countdown function to renderer.js --- renderer.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/renderer.js b/renderer.js index 964c948..6386289 100644 --- a/renderer.js +++ b/renderer.js @@ -307,7 +307,14 @@ folders.forEach(folderObj => { - + // Countdown in MM:SS-Format + function formatCountdown(ms) { + if (!ms || ms <= 0) return '00:00'; + const s = Math.floor(ms / 1000); + const m = Math.floor(s / 60).toString().padStart(2, '0'); + const sec = (s % 60).toString().padStart(2, '0'); + return `${m}:${sec}`; + }