-
Notifications
You must be signed in to change notification settings - Fork 164
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
Introduce auto slashes to text input. #269
Conversation
It’s not always slashes in my language it’s a - sign the code before was detecting that sign automatically is it possible to get that back in too? |
Ahh great point. I didn't even think of that 🤦🏼 and I don't believe we ever ripped out that code, but I guess it stopped working at some point? I see your It turns out the functionality was removed in this pull request. If we reintroduce that functionality we will effectively be reopening the issue associated with the pull request. |
@jpatricksweeney here is the patch i'm currently using in my personal project for this fix using patch-package. This fix works for english, but unfortunately isn't robust enough since not everyone uses "/" (some use "-"). I plan on looking into a proper solution which will be merged into the branch when ready.
|
@RichardLindhout When you get a chance can you check this out? I parameterized the mask, so it should work with any locale and any split character. The idea was a hybrid approach with your existing implementation, but using regular expressions instead of having to double loop. |
Nice! |
Great work @iM-GeeKy ! |
@RichardLindhout Please test this out and make sure it works how we discussed.
@jpatricksweeney This isn't quite ready yet. It doesn't accommodate all scenarios. You might be able to use patch-package to apply this temporarily since not everyone uses the slash in there date representation.
NOTE - Invalid dates of 00/00/0000 and 99/99/9999 can be input, but it doesn't cause any issues. The validation seems to gracefully handle this scenario.