Is it possible to change how telephone numbers are displayed in the “Family” section? The default format looks a bit unfamiliar to UK users.
Hello, this is a very good question, and I am sure there are some formatting tools out there that can do this for us. As an example, can you show how you’d expect a UK phone number to be formatted? Thanks, Ross.
A typical UK fixed phone number in my area would be formatted like this:
01223 502312 (this is an invented number so far as I know!)
The first 5 digits are the area code and the last 6 digits are the actual number.
The international version of this could be either 0044 1223 502312 or +44 1223 502312
A problem I can see with this is that the area code is not always 5 digits so for example a London number would be of the form 020 xxx xxxx (0044 20 xxx xxxx) Other bigger cities use a similar format to London.
Mobile numbers are 07xx xxxxxxx (00447xx xxxxxxx or +447xx xxxxxxx)
Its all a bit of a mishmash I’m afraid and not very standardised but hopefully something could be done to the formatting to make UK numbers appear more like they are normally written here.
https://en.wikipedia.org/wiki/Telephone_numbers_in_the_United_Kingdom
Thanks for the example. This makes sense, and although we wouldn’t necessarily be wanting to code up all possible alternatives ourselves, there seem to be some libraries available to do this kind of formatting.
@ross what do you think about using the following library, which we could use with the table rewrite:
https://github.com/brick/phonenumber
Thanks,
Ross
I am also interested in changing the phone number display preferences. I would like to see (555) 555-5555 to match phone numbers in the US. Has that library been able to offer the options?
Thanks,
Kevin
Hi Kevin, this one got overlooked in the push to get v18 out the door. @ross something for v19? Ross
Sounds do-able for v19. I’ve added it to the feature request planning board: https://github.com/GibbonEdu/core/projects/2
@admin / @ross , it may be useful to note that libphonenumbers has a JS implementation (see https://github.com/google/libphonenumber) this can format a given number into at least a common internationalized format. From there, one could convert the phone number which much more robustness to whichever format is preferred. I would assume we’d need to make some kind of custom formatter for such IO so it can be displayed and mask properly.
You might already have considered it, I’m not sure, but it may make it easier to work with.
Thanks Jim, sounds like an interesting approach. Let’s see what Sandra says, and how it looks in terms of v19 timing. Cheers!