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

Phone Number Formats #84

Closed
NetanelBasal opened this issue Jan 20, 2022 · 9 comments · Fixed by #104
Closed

Phone Number Formats #84

NetanelBasal opened this issue Jan 20, 2022 · 9 comments · Fixed by #104
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed PR is welcome

Comments

@NetanelBasal
Copy link
Member

Description

Support formats in phone number function.

References:

https://gist.github.com/anubhavshrimal/75f6183458db8c453306f93521e93d37
https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers

Proposed solution

No response

Alternatives considered

No response

Do you want to create a pull request?

No

@NetanelBasal NetanelBasal added enhancement New feature or request good first issue Good for newcomers PR is welcome labels Jan 20, 2022
@ikerasiotis
Copy link
Contributor

ikerasiotis commented Jan 20, 2022

How many do we want? Also, do you want to add locales? You could give me the task to make an effort.

@NetanelBasal
Copy link
Member Author

You can use the JSON mentioned here. I'm thinking about something like:

randPhoneNumber({ countryCode: 'AN' }) // +599438438

@NetanelBasal
Copy link
Member Author

I'm open to suggestions, though.

@NetanelBasal NetanelBasal added the help wanted Extra attention is needed label Jan 20, 2022
@ikerasiotis
Copy link
Contributor

Do you want to generate from a regex a phone number? I think the length of the string is different country by country. Also, many developers use validator.js, so it should generate a number that passes the function isMobile().

@NetanelBasal
Copy link
Member Author

Seems fine to me

@theryansmee
Copy link
Collaborator

I'm not sure if this is overkill, but i've user Google phone lib in the past for validating numbers and its great. I think you can also use it to format numbers from lots of diff places? Could help?

@NetanelBasal
Copy link
Member Author

@ikerasiotis I see that @arulprabakaran already did this.

@ikerasiotis
Copy link
Contributor

@NetanelBasal. ok..

@NetanelBasal
Copy link
Member Author

You're welcome to contribute and add more generators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed PR is welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants