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

Add validation for Finnish phone numbers #455

Merged
merged 1 commit into from
Feb 4, 2016

Conversation

simison
Copy link
Contributor

@simison simison commented Nov 26, 2015

Got this from https://en.wikipedia.org/wiki/Telephone_numbers_in_Finland and modified to support 00358 and not only +358 at the beginning of the international format.

Includes tests.

(Lemme know if you want this squashed to one commit.)

@chriso
Copy link
Collaborator

chriso commented Dec 1, 2015

Can we cut down the regex at all? It looks larger than all of the other locales combined 😓

@simison
Copy link
Contributor Author

simison commented Dec 1, 2015

It does look really long, indeed! Crazy. :-) But then, what's the exact problem with that? (other than visual)

It includes Finnish landline numbers as well, where as the other ones seem to include only mobile numbers.

@chriso
Copy link
Collaborator

chriso commented Dec 1, 2015

Ah I see. Mobile phone numbers only then, please. General phone number validation has been requested before, but then the library slowly descends into a crappy version of libphonenumber which is huge.

@simison
Copy link
Contributor Author

simison commented Dec 1, 2015

Aight! Valid point.

I'll ping you once I'm done with the change. Gimme some days.

@chriso
Copy link
Collaborator

chriso commented Dec 1, 2015

No problem, and thanks!

@chriso
Copy link
Collaborator

chriso commented Feb 4, 2016

Any update on this?

@simison
Copy link
Contributor Author

simison commented Feb 4, 2016

Edited + squashed + rebased on top of current master.

Other validators don't validate totally valid leading zeros: 00358 instead of +358. Should I remove that bit as well?

I could send another PR to add them to other phone numbers, tho.

@chriso
Copy link
Collaborator

chriso commented Feb 4, 2016

That looks good. Thanks again 😄

chriso added a commit that referenced this pull request Feb 4, 2016
Add validation for Finnish phone numbers
@chriso chriso merged commit ef7a920 into validatorjs:master Feb 4, 2016
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.

2 participants