Closed jhalborg closed 6 years ago
Why are your users inputting their phone number with 00 prefix?
Released 1.2.0
which supports parsing IDD prefixes.
const number = parseNumber('011 61 2 3456 7890', { fromCountry: 'US' })
// Returns `{ country: 'AU', phone: '234567890' }`
isValidNumber(number)
Why are your users inputting their phone number with 00 prefix?
Because, users! ;) I guess some just have that preference, what can I say :)
But that sounds great, I'll check it out
FYI: I removed fromCountry
parameter from parseNumber()
. It now uses "default country" instead.
@catamphetamine users outside of the states and some European countries doesn't even know what the +is and they always use 00, and really it should be recognizes the same as +
@Chicooz
As I aready wrote, 00
numbers are IDD
and IDD
are numbers dialed from country A to country B.
The input component only has country B.
It seems a lot of my users write their country prefix with 00 instead of + notation. I've now rebuilt the UI so they input country code in one box and the number in the other and validate the result myself so there's no UX confusion, but I think it'd be natural if
+45 12345678 and 0045 12345678 both validated
true
as DK phone numbers