Time validation pattern for Angular / Javascript

Time validator in Angular and Javascript using RegExp patterns

We want to validate an input, the required format is hh:mm


8:59 AM = 08:59

8:59 PM = 20:59

Javascript regular expression


Angular form

formControl = new FormControl('', 

Notice that we are not using a string but a JS/TS RegExp

WebApp built by Marco using SpringBoot, Java 17, Mustache, Markdown and in Azure