You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I played around a little but couldn't find a way to use the country-code instead of the country inside the formatted adress.
There is one similar case in the examples, but that is using { abbreviate: true, countryCode: 'UK' } which replaces 7 countries, depending on src/templates/abbreviations.json (at least I'm assuming that).
I'd want to avoid the path of replacing the country inside the formatted address.
The text was updated successfully, but these errors were encountered:
hi, that's what the abbreviate: true does. It uses additional configuraiton from the file. Can you describe more what would be your expected result? I'd need to take a look back at the code to understand what it's supposed to do and why it does what it does and not what you expect it to do.
I'd want the spelled out country to be abbreviated with it's countryCode:
it('first',()=>{constformatted=addressFormatter.format({"houseNumber": 301,"road": "Hamilton Avenue","neighbourhood": "Crescent Park","city": "Palo Alto","postcode": 94303,"county": "Santa Clara County","state": "California","country": "United States of America","countryCode": "US",},{useCountryCodeInsteadOfCountry: true});expect(formatted).toBe(`301 Hamilton AvenuePalo Alto, CA 94303USA`);// instead of expect(formatted).not.toBe(`301 Hamilton AvenuePalo Alto, CA 94303United States of America`);});
Hi again 👋 ,
I played around a little but couldn't find a way to use the country-code instead of the country inside the formatted adress.
There is one similar case in the examples, but that is using
{ abbreviate: true, countryCode: 'UK' }
which replaces 7 countries, depending onsrc/templates/abbreviations.json
(at least I'm assuming that).I'd want to avoid the path of replacing the country inside the formatted address.
The text was updated successfully, but these errors were encountered: