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

Fullstack Angular / Java application quick start guide.
WebApp built by Marco using SpringBoot 3.2.4 and Java 21. Hosted in Switzerland (GE8).