diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-06-17 00:10:59 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-17 00:10:59 -0500 |
| commit | fb5602e4e295afb418b5a8a83f6b2b422db32f20 (patch) | |
| tree | 0d099b721a1c4bedb5fbeaea9965fb75e253ecdc /src | |
| parent | 487c34b0000a1b997066f6079c45a793fd3f8601 (diff) | |
| parent | 6fedd5c709ac5f382d2ce0f976af1aa5cb9f14fd (diff) | |
| download | slskd-fb5602e4e295afb418b5a8a83f6b2b422db32f20.tar.gz | |
Merge pull request #518 from mattgoldspink/bug/formatSeconds-missing-hours
Tracks that last longer than an hour don't show that.
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/src/lib/util.js | 3 |
1 files changed, 3 insertions, 0 deletions
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'); }; |
