furhter bug fixes and updates

This commit is contained in:
jenz
2026-08-22 17:10:27 +02:00
parent 9e8e8378a2
commit 16bb9e14a5
18 changed files with 1070 additions and 256 deletions
@@ -15,9 +15,12 @@ export function steamProfileUrl(steamId2: string): string | null {
return id64 ? `https://steamcommunity.com/profiles/${id64}` : null;
}
// Formats total minutes as "123h 45m" for display.
// Formats total minutes as "123h 45m" for display. Negative values (which
// shouldn't be possible, but have shown up from anomalous underlying data —
// e.g. a player_time counter that decreased between two session snapshots)
// are shown as "—" rather than a nonsensical negative duration.
export function formatMinutes(totalMinutes: number | null): string {
if (totalMinutes == null || Number.isNaN(totalMinutes)) return '—';
if (totalMinutes == null || Number.isNaN(totalMinutes) || totalMinutes < 0) return '—';
const h = Math.floor(totalMinutes / 60);
const m = totalMinutes % 60;
return `${h}h ${m}m`;