We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would it be possible to add support for flattened city names, where the accents are removed, so we can look up cities irrespective of their accents?
Right now I have a workaround: When I load:
for (let i = 0; i < cityTimezones.cityMapping.length; i++) { // eslint-disable-next-line camelcase (cityTimezones.cityMapping[i] as any).city_flattened = removeAccents(cityTimezones.cityMapping[i].city_ascii).toLowerCase(); }
and then when I lookup:
cityName = removeAccents(cityName).toLowerCase(); cities = CityTimezones.cityMapping; for (let i = 0; i < cities.length; i++) { if ((cities[i] as any).city_flattened === cityName) { return cities[i]; } }
and the implementation for the removeAccents function:
removeAccents
function removeAccents (text: string): string { return text.normalize('NFD').replace(/[\u0300-\u036f]/g, ''); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Would it be possible to add support for flattened city names, where the accents are removed, so we can look up cities irrespective of their accents?
Right now I have a workaround:
When I load:
and then when I lookup:
and the implementation for the
removeAccents
function:The text was updated successfully, but these errors were encountered: