Add countdown function to renderer.js
This commit is contained in:
@@ -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}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user