Skip to content

Commit babce7a

Browse files
committed
Format with prettier
1 parent 04df6ca commit babce7a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎format-clock-edge-cases/timeConverter.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ function formatAs12HourClock(time) {
55
let period = "";
66
let hourString = "";
77

8-
if (hours <= 11){
8+
if (hours <= 11) {
99
period = "am";
1010
} else {
1111
period = "pm";
1212
}
1313

14-
if (hours >= 13){
15-
hourString = hours - 12 < 10 ? `0${hours - 12}` : `${hours -12}`;
16-
} else if (hours === 0){
14+
if (hours >= 13) {
15+
hourString = hours - 12 < 10 ? `0${hours - 12}` : `${hours - 12}`;
16+
} else if (hours === 0) {
1717
hourString = `${hours + 12}`;
1818
} else {
19-
hourString = hours < 10 ? `0${hours}`:`${hours}`;
19+
hourString = hours < 10 ? `0${hours}` : `${hours}`;
2020
}
2121

22-
return `${hourString}:${minutes} ${period}`
22+
return `${hourString}:${minutes} ${period}`;
2323
}
2424

2525
export { formatAs12HourClock };

0 commit comments

Comments
 (0)