There was an error while loading. Please reload this page.
1 parent 6b0f9f4 commit a1a3870Copy full SHA for a1a3870
1 file changed
Sprint-3/5-stretch-extend/format-time.js
@@ -104,7 +104,7 @@ function formatAs12HourClock(time) {
104
return `12:${minutes} pm`;
105
}
106
if (hours > 12) {
107
- return `${hours - 12}:${minutes} pm`;
+ return `${String(hours - 12).padStart(2, "0")}:${minutes} pm`;
108
109
110
@@ -120,7 +120,7 @@ console.assert(
120
console.log(formatAs12HourClock("01:00"))
121
122
const currentOutput2 = formatAs12HourClock("19:30");
123
-const targetOutput2 = "7:30 pm";
+const targetOutput2 = "07:30 pm";
124
125
console.assert(
126
currentOutput2 === targetOutput2,
0 commit comments