carddav2fb icon indicating copy to clipboard operation
carddav2fb copied to clipboard

Use libphonenumber to properly format phone numbers

Open hanzi opened this issue 3 years ago • 6 comments

This replaces the phone number formatting method using strtr() with one that utilises the libphonenumber library (which is PHP port of the Google library with the same name.)

That allows a user to just define the country code where the FRITZ!Box will be used and libphonenumber will handle the rest.

It will automatically apply appropriate formatting for phone numbers and detect whether it's a national or international phone number. See the docblock for the method used: https://github.com/giggsey/libphonenumber-for-php/blob/master/src/PhoneNumberUtil.php#L2643

Fixes #193

hanzi avatar Aug 11 '20 21:08 hanzi