JsDaddy / ngx-mask

Angular Plugin to make masks on form fields and html elements.
https://jsdaddy.github.io/ngx-mask
MIT License
1.17k stars 301 forks source link

adding the value of "00/00/0000" for the mask "M0/d0/0000" is considered valid? #1412

Open abdulrahmanriyaz opened 3 months ago

abdulrahmanriyaz commented 3 months ago

🐞 bug report

Is this a regression?

Not sure.

Description

Its possible to add all zeroes in the date month format and it gets accepted as valid e.g with the mask "M0/d0/0000" the value "00/00/0000" is considered valid. Do you know if this is intended behavior or is this a bug?

<input placeholder="MM/dd/YYYY" mask="M0/d0/0000" [dropSpecialCharacters]="false" [leadZeroDateTime]="true" />

🌍 Your Environment

Angular Version:


Package                         Version
---------------------------------------------------------
@angular/cli                    17.0.1
@angular/compiler-cli           17.0.3
ngx-mask                            ^18.0.0,
propkitty commented 3 weeks ago

I am also having this same problem. Also, if I specifically do the year as 0000 (with month and day correct), it changes the year to 1900 rather than letting me throw it invalid.