Closed SpencerKaiser closed 1 year ago
{ name: 'Jamaica', dial_code: '+1876', code: 'JM', flag: 'π―π²' },
{ name: 'Jamaica', dial_code: '+1658', code: 'JM', flag: 'π―π²' },
or
{ name: 'Jamaica', dial_code: '+1876', dial_codes: ['+1876', '+1658'], code: 'JM', flag: 'π―π²' },
Which one do you think is better?
Honestly I think I would prefer the flexibility of knowing what's an area code vs what's a country code, so something like this would be my preferred option, but the second is definitely better IMO; first is simpler to use but has way too much data overlap
{ name: 'Jamaica', dial_code: '+1', area_codes: ['876', '658'], code: 'JM', flag: 'π―π²' },
Honestly I think I would prefer the flexibility of knowing what's an area code vs what's a country code, so something like this would be my preferred option, but the second is definitely better IMO; first is simpler to use but has way too much data overlap
{ name: 'Jamaica', dial_code: '+1', area_codes: ['876', '658'], code: 'JM', flag: 'π―π²' },
It is very nice suggestion.
But This plugin is more about dial code
which is country code
+ area code
together.
In your case, it is country code
and area codes
.
And if someone want to show list on available dial codes, then he have loop again with area codes. So I think we better stick with this solution.
{ name: 'Jamaica', dial_code: '+1876', code: 'JM', flag: 'π―π²' },
{ name: 'Jamaica', dial_code: '+1658', code: 'JM', flag: 'π―π²' },
I think that's totallyΒ fine, but it'd still be a great addition to have the country code split out as a separate element. If I don't want Jamaica
showing twice, I have no real options because I don't know how to split the country code from the area code. At some point in the future, adding country_code
in addition to dial_code
would be great, even if the country code is redundant on the dial code field.
Countries like the Dominican Republic and Jamaica have several
area codes
but the library has chosen one of several and forced it... can we either get additional countries added for the variety of area codes OR (preferably) remove the area code either entirely or remove the area code when there are multiple for a given country?Full list of country codes can be found here with area codes being broken out into parentheses when applicable: https://en.wikipedia.org/wiki/List_of_country_calling_codes