aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/island/Logic.js
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/island/Logic.js')
-rw-r--r--desktop/island/Logic.js9
1 files changed, 9 insertions, 0 deletions
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;
+}