configure typescript + begin conversion

This commit is contained in:
p2405951 committed 2026-01-28 16:29:41 +01:00
1 parent 3c71e0c7b2
commit ea6fd94962
14 files changed
+381 -128

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
export default function formatTime(d: string | Date | null | undefined): string {
if (!d) return "Heure inconnue";
const date = d instanceof Date ? d : new Date(d);
if (isNaN(date.getTime())) return "Heure invalide";
const hh = String(date.getUTCHours()).padStart(2, "0");
const min = String(date.getUTCMinutes()).padStart(2, "0");
return `${hh}:${min}`;
}