I am trying to create a javascript function with regular expression to validate and format the time 24 hours, accepting times without semicolon and removing spaces.
Examples:
If the user types "0100"
, " 100"
or "100 "
it would be accepted but formatted to "01:00"
If the user types "01:00"
it would be accepted, with no need to format.
Thanks.