There was an error while loading. Please reload this page.
1 parent ddfce92 commit 3443fafCopy full SHA for 3443faf
1 file changed
Sprint-3/5-stretch-extend/format-time.js
@@ -3,7 +3,7 @@
3
// Your task is to write tests for as many different groups of input data or edge cases as you can, and fix any bugs you find.
4
function formatAs12HourClock(time) {
5
const hours = Number(time.slice(0, 2));
6
- const minutes = time.slice(3);
+ const minutes = time.slice(-2);
7
8
const period = hours >= 12 ? "pm" : "am";
9
const hours12 = hours % 12 === 0 ? 12 : hours % 12;
0 commit comments