Undiverge main branch from projector branch

This commit is contained in:
Koper
2023-10-12 14:12:34 +01:00
parent 35af25d4e8
commit 4e80e1cdb3
8 changed files with 395 additions and 2 deletions

View File

@@ -9,3 +9,18 @@ export const formatTime = (seconds: number): string => {
return timeString;
};
export const formatTimeDifference = (seconds: number): string => {
let hours = Math.floor(seconds / 3600);
let minutes = Math.floor((seconds % 3600) / 60);
let secs = Math.floor(seconds % 60);
let timeString =
hours > 0
? `${hours < 10 ? "\u00A0" : ""}${hours}h ago`
: minutes > 0
? `${minutes < 10 ? "\u00A0" : ""}${minutes}m ago`
: `<1m ago`;
return timeString;
};