changhuixu / ngx-digit-only

An Angular directive to only allow [0-9] in the input box when typing, pasting or drag/dropping.

Home Page:https://changhuixu.github.io/ngx-digit-only/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow for padding on mask

davija opened this issue · comments

Currently, the pattern and mask seem to be very rigid...

It would be nice to define something like this:

What this should do (assuming my regex is correct) is allow for inputs of the following:
3/25
1/15
02/01
03/23

For some reason, most of these do NOT work.

02/01 - works
03/23 - works

Trying to type 3/25 yields -> 32/5
Trying to type 1/15 yields -> 11/5

Is there a way when the user types 3/ to force it to recognize that the user really means 03/?