This commit is contained in:
2023-08-08 17:04:21 +00:00
parent 31ecda89b2
commit ec382e989a
147 changed files with 18206 additions and 18063 deletions

View File

@@ -1,14 +1,14 @@
// function that receives two hours in hh:mm format and compares as a spaceship operator
export function compareHours(h1, h2) {
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;
}
// function that receives two hours in hh:mm format and compares as a spaceship operator
export function compareHours(h1, h2) {
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;
}