Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | 11x 851x 1x 850x 850x 850x 850x 2x 848x 578x 270x 267x 3x 1x 2x 846x 846x 846x 11x 425x | export const hhmmTohhmma = (HHMM) => {
if (HHMM === null) {
return "";
}
var time = HHMM.split(':');
var hours = Number(time[0]);
var minutes = Number(time[1]);
var timeValue;
if (minutes > 59 || minutes < 0) {
return "";
}
if (hours > 12 && hours < 24) {
timeValue= "" + (hours - 12);
} else if (hours > 0 && hours <= 12) {
timeValue= "" + hours;
} else if (hours === 0) {
timeValue= "12";
} else {
return "";
}
timeValue += (minutes < 10) ? ":0" + minutes : ":" + minutes; // get minutes
timeValue += (hours >= 12) ? " PM" : " AM"; // get AM/PM
return timeValue;
}
export const convertToTimeRange = (time1, time2) => {
return (time1 !== "" && time2 !== "") ? `${time1} - ${time2}` : "";
} |