Keystroke script to display string into HH:MM:ss tt
I found a keystroke script that would convert a 4 digits into HH:MM format, but want to go beyond that and convert to HH:MM:ss tt (e.g. 1645 into 4:45:00 PM.) Here is the script I currently use.
if(event.willCommit)
{
event.value = event.value.toString().replace(/(\d{1,2})[\,\.]?(\d{2})/,"$1:$2");
}
