Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

masking a datetime seems to go wrong #223

Closed
Maw-Jung opened this issue Apr 18, 2018 · 6 comments
Closed

masking a datetime seems to go wrong #223

Maw-Jung opened this issue Apr 18, 2018 · 6 comments

Comments

@Maw-Jung
Copy link

In version 2.6.2 the commit 71fb27f introduced a new function called 'applyMask'. The 'maskedValue' is checked against allowed characters and uses the mask character whenever one is found in the allowed characters and the actual value otherwise. In the latter case the counter isn't increased.

@Gillardo
Copy link
Owner

Not sure I understand? Can u add plunkr to show?

@Maw-Jung
Copy link
Author

Maw-Jung commented Apr 18, 2018

"18.04.2018 11:57 PM" with a format of "dd.MM.yyyy hh:mm a" will become "18..0.4.20 18: 1 a" because the variable 'valueArrayIndex' will only be increased for characters found in the allowed characters. Just take any plnkr and slap the current datetimepicker library (2.6.2) on it: http://plnkr.co/edit/qTXYhDMtTzvK7UWlr3Fy?p=preview
By debugging into the function when selecting any date you can see the described result

@Gillardo
Copy link
Owner

I would need to look at the code. Someone else created the pulse request for it

@Gillardo
Copy link
Owner

@afro1114 ???

@Blackbaud-ChristopherHlusak

I believe we experienced a problem with the adjustment of this area of the code as well. A date format of M/d/yyyy will let dates with two digit months to pass the regex (since if you drop the first character from 12/3/2017 it will be 2/3/2017) but a date with two digit days fails this, since 4/17/2018 won't match d/d/dddd pattern - which arguably it should. (worked with 2.6.1).

Perhaps I am misunderstanding the expectation of how the date format should work, but wanted to raise this case here in the event it's helpful.

@Gillardo
Copy link
Owner

I have disabled masking as this seems to be causing issues for people. I have uploaded 2.6.3, hopefully this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants