From 8b3f0e911b5a296e664171c6135e674a4f101840 Mon Sep 17 00:00:00 2001 From: Matt Goldspink Date: Thu, 16 Jun 2022 21:07:31 -0700 Subject: Tracks that last longer than an hour don't show that. I've fixed up the formatSeconds to test if it's longer than an hour then show the extra portion. --- src/web/src/lib/util.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/web/src/lib/util.js b/src/web/src/lib/util.js index 94095efa..20653737 100644 --- a/src/web/src/lib/util.js +++ b/src/web/src/lib/util.js @@ -3,6 +3,9 @@ export const formatSeconds = (seconds) => if (isNaN(seconds)) return ''; var date = new Date(1970,0,1); date.setSeconds(seconds); + if (seconds >= 3600) { + return date.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, '$1'); + } return date.toTimeString().replace(/.*(\d{2}:\d{2}).*/, '$1'); }; -- cgit v1.2.3