File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Sprint-1/2-mandatory-errors Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ function convertTo12HourClockTime(time24clock) {
1515 hours -= 12 ; // Convert to 12-hour format
1616 }
1717
18- return `${ hours } :${ minutes . toString ( ) . padStart ( 2 , "0" ) } ${ modifier } ` ;
18+ return `${ hours . toString ( ) . padStart ( 2 , "0" ) } :${ minutes . toString ( ) . padStart ( 2 , "0" ) } ${ modifier } ` ;
1919}
2020function convertTo24HourClockTime ( time12clock ) {
2121 let [ time , modifier ] = time12clock . split ( " " ) ;
@@ -31,7 +31,4 @@ function convertTo24HourClockTime(time12clock) {
3131 . toString ( )
3232 . padStart ( 2 , "0" ) } `;
3333}
34- console . log ( convertTo12HourClockTime ( twentyFourHourClockTime ) ) ; // Output: "08:53 PM"
35- console . log ( convertTo24HourClockTime ( twelveHourClockTime ) ) ; // Output: "20:53"
36- // Output: "20:53"
37- // Output: "08:53 PM"
34+ console . log ( convertTo12HourClockTime ( twentyFourHourClockTime ) ) ; // Output: "08:53 PM"
You can’t perform that action at this time.
0 commit comments