Skip to content

Adding Brazilian Formatting #45

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cristovao-trevisan
Copy link

I'm adding the brazilian phone format. The problem is that the format may change among the states (and cities), including an extra number.
It may look like this: +55 (..) ....-....
Or like this: like this: +55 (..) .....-....

I decided to add another string match for optional numbers, to be set only when all the dots are already fulfilled, and named it "?".

Also I think the length of the input should not be longer than the format specifies (don't know if this is a general case though), so I removed the possibility for the formatted number to outgrow the specification.

I also changed the default validity function to check the format after it the input has been clicked.

@cristovao-trevisan cristovao-trevisan changed the title Adding Brazil Formatting Adding Brazilian Formatting May 22, 2017
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

Successfully merging this pull request may close these issues.

1 participant