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

Invalid country being returned for Virgin Islands #12

Open
tsaifi9 opened this issue Sep 16, 2022 · 1 comment
Open

Invalid country being returned for Virgin Islands #12

tsaifi9 opened this issue Sep 16, 2022 · 1 comment

Comments

@tsaifi9
Copy link

tsaifi9 commented Sep 16, 2022

Running into an issue with validating numbers from Virgin Islands

Problem:

  • country is returning US for Virgin Islands

Expectation:

  • country should return VI for Virgin Islands

Setup:

virgin_islands_phone_number = "+13407759575"
phone = MiniPhone.parse(virgin_islands_phone_number)


phone.valid? # => false
p.country # => "US"


MiniPhone.valid_for_country?(virgin_islands_phone_number, 'VI') # true
@espen
Copy link
Contributor

espen commented Jan 7, 2023

I think this is an issue with libphonenumber returning +1 as country code. See https://libphonenumber.appspot.com/phonenumberparser?number=%2B13407759575

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

No branches or pull requests

2 participants