I\'ve been playing with jquery and I\'ve run myself into a time problem. I\'ve got 3 time input select boxes, one for hours, one for minutes, and one for the Meridian. I need to
var time = "";
var hour = Number($("#EventCloseTimeHour option:selected").text())%12 + ($("#EventCloseTimeMeridian option:selected").text() == 'PM'?12:0)) ;
time +=("00"+String(hour)).slice(-2)+":"+ $("#EventCloseTimeMin option:selected").text();
The key to this solution is using the conditional operator "a?b:c" which translates to "if a then b else c"