The function returns the time in 24 hour format.
function fomartTimeShow(h) { return h < 10 ? \"0\" + h + \":00\" : h + \":00\"; }
You could try something like the following:
function fomartTimeShow(h) { var ampm = "am" if (h >= 12) ampm = "pm" h = h % 12; if (h == 0) h = 12; return h ":00" + ampm; }