fitness: fix duration display treating minutes as seconds
All checks were successful
CI / update (push) Successful in 1m58s

The DB stores duration in minutes but formatDuration was dividing
by 3600/60 as if receiving seconds, always showing 0m.
This commit is contained in:
2026-03-19 09:46:24 +01:00
parent c9e8e9919c
commit 640a986763
2 changed files with 8 additions and 8 deletions

View File

@@ -20,10 +20,10 @@
*/
let { session } = $props();
/** @param {number} secs */
function formatDuration(secs) {
const h = Math.floor(secs / 3600);
const m = Math.floor((secs % 3600) / 60);
/** @param {number} mins */
function formatDuration(mins) {
const h = Math.floor(mins / 60);
const m = mins % 60;
if (h > 0) return `${h}h ${m}m`;
return `${m}m`;
}

View File

@@ -9,10 +9,10 @@
const session = $derived(data.session);
let deleting = $state(false);
/** @param {number} secs */
function formatDuration(secs) {
const h = Math.floor(secs / 3600);
const m = Math.floor((secs % 3600) / 60);
/** @param {number} mins */
function formatDuration(mins) {
const h = Math.floor(mins / 60);
const m = mins % 60;
if (h > 0) return `${h}h ${m}m`;
return `${m}m`;
}