rynpsc / craft-phone-number

Phone Number field for Craft CMS.
https://plugins.craftcms.com/phone-number
MIT License
22 stars 3 forks source link

getCountryCode() and getRegionCode() are mixed up #17

Closed StijnCoolen closed 2 years ago

StijnCoolen commented 2 years ago

According to docs:

{{ entry.phone.getCountryCode() }} - The alphabetical country code
{{ entry.phone.getRegionCode() }} - The numerical region code

Actual (php code):

->getRegionCode() returns the alphabetical country code (ES when using Spanish phone nr.) ->getCountryCode() returns the numerical region code (34 when using Spanish phone nr.)

This also matches the libphonenumber-for-php docs