This might be really easy but I can’t figure it out. I am trying to convert the 24 hr time to a 12 hr time to display on the UI.
var hrs = '<%=Model.Scheduled.Value.Hour%>';
var hrs12 = hrs > 12 ? hrs - 12 : hrs;
$("#ScheduledHour").val(hrs12);
But the above is not working coz hrs is a string. Any suggestions on how to get this working?
you can use
parseInt():