Skip to content

Commit 96b65cf

Browse files
Formate change as per pre section instructions
1 parent e631272 commit 96b65cf

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
function formatAs12HourClock(time) {
2-
32
const hours = Number(time.slice(0, 2));
43

4+
if (time === "00:00") {
5+
return `12:00 am`;
6+
}
7+
58
if (hours > 12) {
69
return `${hours - 12}:00 pm`;
710
}
811
return `${time} am`;
912
}
1013

11-
export {formatAs12HourClock};
14+
export { formatAs12HourClock };

0 commit comments

Comments
 (0)