Closed eddie-englund closed 3 years ago
Forget I ever posted this :)
Or actually, I get successful on the demo page, but not in the code.
My check is simple.
import parsePhoneNumberFromString, { E164Number, PhoneNumber } from "libphonenumber-js";
const phoneNumber: PhoneNumber | undefined = parsePhoneNumberFromString(_phoneNumber);
Provide the exact input to both demos, make screenshots and then compare.
This is what I posted, but you say there's a second demo. I must have missed that.
This is the URL: https://libphonenumber.appspot.com/phonenumberparser?number=%2B46+70+512+61+12&country=SE&geocodingLocale=se-SE
Your issue description is not valid. You're passing different numbers. Re-create the issue, I'm closing this one because it's become offtop.
Alright, I'll make a new issue and will provide further info :)
Steps to reproduce
Parse a Swedish phone number with
In Sweden it's common practice to remove the first digit 0 after +46.
Example +46 070 512 61 12
Observed result
Returns as not not valid.
Expected result
What's the expected result?
Expected result is to receive this as successful and the .number value to have an added 0 in the beginning.
Google's demo link
Returns:
Phone Number entered: +46 07+ 512 61 12 defaultCountry entered: SE Language entered: se-SE Error type: NOT_A_NUMBER. The string supplied did not seem to be a phone number.