Skip to content

Commit 550232a

Browse files
committed
5-stretch-extend is done.
1 parent 5952762 commit 550232a

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Sprint-2/5-stretch-extend/format-time.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,24 @@ console.assert(
2323
currentOutput2 === targetOutput2,
2424
`current output: ${currentOutput2}, target output: ${targetOutput2}`
2525
);
26+
27+
const currentOutput3 = formatAs12HourClock("00:00");
28+
const targetOutput3 = "12:00 am";
29+
console.assert(
30+
currentOutput3 === targetOutput3,
31+
`current output: ${currentOutput3}, target output: ${targetOutput3}`
32+
);
33+
34+
const currentOutput4 = formatAs12HourClock("12:00");
35+
const targetOutput4 = "12:00 pm";
36+
console.assert(
37+
currentOutput4 === targetOutput4,
38+
`current output: ${currentOutput4}, target output: ${targetOutput4}`
39+
);
40+
41+
console.log(formatAs12HourClock("08:00"));
42+
console.log(formatAs12HourClock("23:00"));
43+
console.log(formatAs12HourClock("00:00"));
44+
console.log(formatAs12HourClock("12:00"));
45+
46+
//The function did not handle the edge cases 00:00 and 12:00.

0 commit comments

Comments
 (0)