We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 321dd76 commit 40e6f4fCopy full SHA for 40e6f4f
Sprint-2/5-stretch-extend/format-time.js
@@ -18,11 +18,18 @@ function formatAs12HourClock(time) {
18
return `12:${minutes} am`;
19
}
20
21
+ if (time.charAt(0) === "0") {
22
+ return `${time.slice(1)} am`;
23
+ }
24
+
25
return `${time} am`;
26
27
-const currentOutput = formatAs12HourClock("00:30");
-const targetOutput = "12:30 am";
28
+console.log(`the 12 hr format for 01:01 is ${formatAs12HourClock("05:01")}`);
29
+console.log(`the 12 hr format for 13:01 is ${formatAs12HourClock("13:01")}`);
30
31
+const currentOutput = formatAs12HourClock("01:01");
32
+const targetOutput = "1:01 am";
33
console.assert(
34
currentOutput === targetOutput,
35
`current output: ${currentOutput}, target output: ${targetOutput}`
0 commit comments