fixes comment look and feel

This commit is contained in:
Christian Beutel
2025-01-04 17:51:19 +01:00
parent a704db6366
commit 2cc01744da
17 changed files with 145 additions and 36 deletions

View File

@@ -12,7 +12,7 @@ export function formatTimeHHMM(minutes?: number) {
return (h < 10 ? "0" : "") + h.toString() + "h " + (Math.round(m) < 10 ? "0" : "") + Math.round(m).toString() + "m";
}
export function formatDistance(meters?: number) {
export function formatDistance(meters?: number) {
if (meters === undefined) {
return "-";
}
@@ -66,11 +66,9 @@ export function formatSpeed(speed?: number) {
}
export function formatTimeSince(date: Date) {
const seconds = Math.floor((new Date().getTime() - date.getTime()) / 1000);
var seconds = Math.floor((new Date().getTime() - date.getTime()) / 1000);
var interval = seconds / 31536000;
let interval = seconds / 31536000;
if (interval > 1) {
return { unit: "years", value: Math.floor(interval) };
}
@@ -90,5 +88,5 @@ export function formatTimeSince(date: Date) {
if (interval > 1) {
return { unit: "minutes", value: Math.floor(interval) };
}
return { unit: "seconds", value: Math.floor(interval) };
return { unit: "seconds", value: seconds };
}