ngx-mask icon indicating copy to clipboard operation
ngx-mask copied to clipboard

Date formatting does not work correctly if month is placed before day

Open alphatwit opened this issue 4 years ago • 2 comments

🐞 bug report

Is this a regression?

No

Description

mask value d0/M0/0000 works as expected, with either one or two digits allowed in the month and day positions, however if the mask is written as M0/d0/0000 then one or two digits are allowed in the first (month) position, but one digit is not allowed in the day position and the input refuses to take the '/' delimiter until a second digit is entered

🔬 Minimal Reproduction

https://stackblitz.com/edit/ngx-mask-qqyxzi?file=src/app/app.component.html

🌍 Your Environment

Angular Version:

11.0.4
also observed in 10.x.x

alphatwit avatar Dec 09 '20 23:12 alphatwit

Is there any update on this issue? This is a big problem if you can't use month/day/year format

cmb0335 avatar Feb 17 '21 20:02 cmb0335

Having the same problem!

randysimplist avatar Jun 21 '21 16:06 randysimplist

I can confirm this issue with Angular 15 and date formats like 0000-M0-d0. In Angular 14 this was still working properly.

elementalTIMING avatar Nov 29 '22 14:11 elementalTIMING

@mounitsyna @cmb0335 @randysimplist @elementalPRESS
Thank you for using ngx-mask. Please update ngx-mask to latest version. https://stackblitz.com/edit/angular-awcvr8?file=src%2Fmain.ts

andriikamaldinov1 avatar May 12 '23 09:05 andriikamaldinov1

@andriikamaldinov1 if using Angular 13, planning to move to Angular 14, 15, 16 and beyond, replacing some other mask lib that is deprecated. How can I get this to work with "M0/d0/0000" without upgrading to latest?

JasonFoglia avatar Dec 18 '23 20:12 JasonFoglia