Initial state

This commit is contained in:
2023-05-16 10:16:21 -06:00
commit c3c0108143
167 changed files with 20135 additions and 0 deletions

10
ts/date_functions.ts Normal file
View File

@@ -0,0 +1,10 @@
// function that receives two hours in hh:mm format and compares as a spaceship operator
export function compareHours(h1: string, h2: string): number {
const [h1h, h1m] = h1.split(":").map(Number);
const [h2h, h2m] = h2.split(":").map(Number);
if (h1h > h2h) return 1;
if (h1h < h2h) return -1;
if (h1m > h2m) return 1;
if (h1m < h2m) return -1;
return 0;
}