fixes comment look and feel
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
Reference in New Issue
Block a user