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
Support multiple delimiters #37
Comments
@vicentedealencar +1 to support this feature, for Brazil will be an awesome feature. |
That's will be great. WE haven't good libs that support brazilian formats. +1 |
Another way would be to supercharge the {
blocks: [3, '.', 3, '.', 3, '-', 2]
} Which would be nice for other uses as well: {
blocks: [3, '.', 2, '%']
} |
@gibatronic I liked your idea, but this change will have a good impact in the library. |
yea @renatoagds... it would be hard to avoid weird glitches. 😔 |
I've submitted a suggestion for an |
Amazing @gibatronic.. I am going to look that today, maybe I could help w/ something. |
Sorry guys, I've closed the Besides, multiple Cheers. |
Release published. Please see: https://github.com/nosir/cleave.js/blob/master/doc/options.md#delimiters A demo is added to homepage: http://nosir.github.io/cleave.js/ Cheers. |
Awesome, dude! One thing, it looks like there is a missing |
Oops, will fix it at night. Good catch! |
Today there is only support for a single delimiter, so some more complex patterns can't be done.
Some examples:
999.999.999-99
BR CPF (like US social security for BR people)(99)99999-9999
BR phoneMy proposal to fix that is add
delimiters
option that would take a array of delimiters, each to be used one time in the rigth order between blocks. This wouldn't add breaking changes. Maybe some validations should be applied like not allowing bothdelimiter
anddelimiters
at the same time, anddelimiters.length === blocks.length - 1
.The options passed to a CPF input would be
The text was updated successfully, but these errors were encountered: