Migrate to typescript

This commit is contained in:
Koper
2023-08-16 17:55:47 +07:00
parent 33ab54a626
commit ebbf47b895
24 changed files with 329 additions and 155 deletions

11
www/app/lib/time.tsx Normal file
View File

@@ -0,0 +1,11 @@
export const formatTime = (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 + ":" : ""}${minutes
.toString()
.padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
return timeString;
};