We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi
Please see these updated line of code so we can handle these two new cases:
` // Clean up area code from the phone number if present if (phone.indexOf('+' + areaCode) === 0) { phone = phone.substring(areaCode.length + 1); } else if (phone.indexOf('00' + areaCode) === 0) { phone = phone.substring(areaCode.length + 2); } else if (phone.indexOf(areaCode + ' ') === 0) { // handle country code + space (ex: "45 30270000") phone = phone.substring(areaCode.length + 1); } // Handle Swedish phone number starting with 0 (but not 0046) if (countryCode === 'se') { if (phone.indexOf('0') === 0 && phone.substring(0, 4) !== '0046') { phone = phone.substring(1); } }
The text was updated successfully, but these errors were encountered:
Replied on Slack.
All except the Swedish national phone number support is already covered.
Sorry, something went wrong.
The Swedish national phone number support is part of #5 and stape-io/phone-number-formatter-variable#2.
giovaniortolani
No branches or pull requests
Hi
Please see these updated line of code so we can handle these two new cases:
` // Clean up area code from the phone number if present
if (phone.indexOf('+' + areaCode) === 0) {
phone = phone.substring(areaCode.length + 1);
} else if (phone.indexOf('00' + areaCode) === 0) {
phone = phone.substring(areaCode.length + 2);
} else if (phone.indexOf(areaCode + ' ') === 0) { // handle country code + space (ex: "45 30270000")
phone = phone.substring(areaCode.length + 1);
}
// Handle Swedish phone number starting with 0 (but not 0046)
if (countryCode === 'se') {
if (phone.indexOf('0') === 0 && phone.substring(0, 4) !== '0046') {
phone = phone.substring(1);
}
}
The text was updated successfully, but these errors were encountered: