Active
Project:
Phone Number
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Sep 2014 at 03:50 UTC
Updated:
9 Sep 2014 at 04:14 UTC
Jump to comment: Most recent
The countries in the North American Number Plan (US, Canada, etc) all have the same format, which is +1 (ppp) nnn-nnnn
They all have the country code +1. Some of the countries in the plan, like US, Canada, and Bermuda are formatted right, but I note that at least St. Lucia is not.
How can we most effectively fix this? Would it make sense to format based on country code == +1, or by country code?
As a temporary function, I have themed it with the following code added to the global formatting function:
if (isset($custom_cc[$element['country_codes']])) {
$function = $element['country_codes'] . '_formatter_default';
if (function_exists($function)) {
$phone = $function($element);
}
} elseif ($cc['code']=="+1") { // if part of NANP, use US formatting
$function = 'us_formatter_default';
$phone = $function($element);
}
Comments
Comment #1
cayenne commented