Skip to content

Commit cdcbc38

Browse files
committed
run prettier for timeConverter.js
1 parent 8baa8cb commit cdcbc38

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
function formatAs12HourClock(time) {
2-
const stringHours =time.slice(0,2);
2+
const stringHours = time.slice(0, 2);
33
const mints = time.slice(-2);
44
const hours = Number(time.slice(0, 2));
5-
if (time === "24:00"){
6-
return `12:00 am`
5+
if (time === "24:00") {
6+
return `12:00 am`;
77
}
8-
if(time ==="12:00"){
9-
return `12:00 pm`
8+
if (time === "12:00") {
9+
return `12:00 pm`;
1010
}
11-
if(stringHours == "00"){
12-
return `12:${mints} am`
13-
14-
}
15-
if(hours=== 12) {
16-
return `${hours}:${mints} pm`
11+
if (stringHours == "00") {
12+
return `12:${mints} am`;
13+
}
14+
if (hours === 12) {
15+
return `${hours}:${mints} pm`;
1716
}
1817
if (hours > 12) {
1918
return `${hours - 12}:${mints} pm`;
2019
}
2120
return `${time} am`;
2221
}
2322

24-
export {formatAs12HourClock};
23+
export { formatAs12HourClock };

0 commit comments

Comments
 (0)