i need to force input to enter time in 24h format
sample
23:40 -- and force only connect number i tried with regular expression but it does not work
You could use a mask something like [/[0-2]/, /[0-9]/, ':', /[0-5]/, /[0-9]/] might do the trick. But its not perfect as it allows values like 25:00. You could take a look at the createAutoCorrectedDatePipe addon and maybe adapt that to work with times.. shouldn't be too difficult.
as i mention before i used the same [/[0-2]/, /[0-9]/, ':', /[0-5]/, /[0-9]/] but i need more friendly experience look like i have to use createAutoCorrectedDatePipe
Also, user could enter "9:20" instead of "09:20", how deal with that?
Most helpful comment
You could use a mask something like
[/[0-2]/, /[0-9]/, ':', /[0-5]/, /[0-9]/]might do the trick. But its not perfect as it allows values like25:00. You could take a look at thecreateAutoCorrectedDatePipeaddon and maybe adapt that to work with times.. shouldn't be too difficult.