Fix wrongly calculated dashboards

This commit is contained in:
Tim Zöller 2026-04-08 00:03:10 +02:00
parent f70c95b3bb
commit e78a03b41b
6 changed files with 67 additions and 26 deletions

View file

@ -305,7 +305,10 @@
}
function formatPRValue(type, value, unit) {
if (unit === 'seconds') {
// 'seconds' (race finish times) and 'seconds_per_km' (pace) both render
// as h:mm:ss / mm:ss. Previously the dashboard only handled 'seconds',
// so pace records fell through and showed as raw integer seconds.
if (unit === 'seconds' || unit === 'seconds_per_km') {
const hours = Math.floor(value / 3600);
const minutes = Math.floor((value % 3600) / 60);
const seconds = Math.floor(value % 60);