From 59fc42e0e23911abeec84fb3bc6c2fcf77ae08c6 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 17 Oct 2026 12:15:49 +0200 Subject: island: elapsed-time helper for the OBS pill --- desktop/island/Logic.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'desktop/island/Logic.js') diff --git a/desktop/island/Logic.js b/desktop/island/Logic.js index e79625c..24458cd 100644 --- a/desktop/island/Logic.js +++ b/desktop/island/Logic.js @@ -62,3 +62,12 @@ function parseOpenWindow(data) { const p = String(data || "").split(","); return { address: p[0] || "", workspace: p[1] || "", appClass: p[2] || "" }; } + +// OBS's outputDuration (ms) as mm:ss, or h:mm:ss past an hour. +function obsElapsed(ms) { + const s = Math.floor((ms > 0 ? ms : 0) / 1000); + const two = n => String(n).padStart(2, "0"); + const h = Math.floor(s / 3600); + const mmss = `${two(Math.floor(s / 60) % 60)}:${two(s % 60)}`; + return h ? `${h}:${mmss}` : mmss; +} -- cgit v1.2.3