Comments (5)
Why would you need that
from libphonenumber-js.
In my application, I know the country from where the user is coming from, so I would like to pre-fill his country code while prompting for phone number.
Just now read other issues.
#63 (comment)
How do I access metadata. Is metadata
exposed?
from libphonenumber-js.
Use getPhoneCode()
of the new version [email protected]
from libphonenumber-js.
@halt-hammerzeit: Thanks! That was a blazing fast release. π
It would be great if you can update this in README.md
file as well, so that people wouldn't bug you.
from libphonenumber-js.
Use getCountryCallingCode()
:
Returns country calling code for a country. Will throw an error if country doesn't exist or isn't supported by this library.
import { getCountryCallingCode } from 'libphonenumber-js';
getCountryCallingCode('RU') === '7'
getCountryCallingCode('IL') === '972'
from libphonenumber-js.
Related Issues (20)
- parsePhoneNumberWithError() return isValid() === 'false' but not throw an error HOT 3
- Some HK mobile numbers (9291****) are not yet supported in this library HOT 1
- Belgium phone number are valid even if they can't be parsed for national display HOT 1
- When using AsYouType with US Country code, if number starts with 1 it formats incorrectly. HOT 1
- country code duplication for some countries HOT 2
- ParsePhoneNumber mistakes the two first digits as the country code HOT 1
- When editing a formatted number the cursor moves to the end HOT 1
- Get countryCode, countryName, countryFlag object HOT 4
- isValidPhoneNumber function return wrong result HOT 1
- +15575001171 number not validated as valid phone number when it is valid by Google's libphonenumber HOT 5
- isValidPhoneNumber and parsePhoneNumber validate the number incorrectly HOT 6
- Missing area code 861 HOT 1
- ts(1479) error in index.d.cts HOT 3
- Unable to delete characters if there is a parenthesis HOT 1
- Any property returns area code? HOT 3
- Different Results |Β Real Life vs Demo HOT 2
- validatePhoneNumberLength does not return TOO_LONG for invalid Ukrainian phone number HOT 9
- Some North American countries receive incorrect National Format when removing digits
- Cuba added a new prefix 63 to phone number HOT 1
- New HK Hutchison telecom mobile number range not yet updated HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libphonenumber-js.