Skip to content

Fix PartialFormatter for regions that are not the main country#42

Merged
marmelroy merged 1 commit intomarmelroy:masterfrom
fikus:partial-formatter-not-main-country
Apr 8, 2016
Merged

Fix PartialFormatter for regions that are not the main country#42
marmelroy merged 1 commit intomarmelroy:masterfrom
fikus:partial-formatter-not-main-country

Conversation

@fikus
Copy link
Copy Markdown
Contributor

@fikus fikus commented Apr 7, 2016

The metadata number formats are only specified for the country
code's main country. Since PartialFormatter was using the metadata
of the region code, a region that is not the code's main country
would not have a format and PartialFormatter would leave the input
unchanged.

Fix by always using the main country for the region's country code.
This matches the behavior of libphonenumber.

The metadata number formats are only specified for the country
code's main country. Since PartialFormatter was using the metadata
of the region code, a region that is not the code's main country
would not have a format and PartialFormatter would leave the input
unchanged.

Fix by always using the main country for the region's country code.
This matches the behavior of libphonenumber.
@marmelroy
Copy link
Copy Markdown
Owner

Thanks a lot @fikus. Another awesome PR! 👍

@marmelroy marmelroy merged commit e91024d into marmelroy:master Apr 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants