time data management

This commit is contained in:
vcoppe
2024-06-18 12:35:24 +02:00
parent 4225db3c04
commit 5f9d609a04
10 changed files with 287 additions and 52 deletions

View File

@@ -30,7 +30,7 @@ export function distancePerHourToSecondsPerDistance(value: number) {
export function secondsToHHMMSS(value: number) {
var hours = Math.floor(value / 3600);
var minutes = Math.floor(value / 60) % 60;
var seconds = Math.round(value % 60);
var seconds = Math.min(59, Math.round(value % 60));
return [hours, minutes, seconds]
.map((v) => (v < 10 ? '0' + v : v))