Every line of 'convert 24 hours to 12 hours javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
120 convertTo24Hour( hour ) { 121 if ( 'PM' === this.amPmRef.current.value && hour < 12 ) { 122 hour += 12; 123 } else if ( 'AM' === this.amPmRef.current.value && 12 === hour ) { 124 hour = 0; 125 } 126 127 return hour; 128 }
72 function timeRangeTo12Hours({ start, end }) { 73 return timeTo12Hours(start) + ' - ' + timeTo12Hours(end); 74 }
83 export function hr12toInt(time: string) { 84 return hr24toInt(to24hr(time)); 85 }