manuelmhtr / countries-and-timezones

Minimalistic library to work with countries and timezones data
MIT License
234 stars 68 forks source link

v2.0.1: no timezones for RO country #8

Closed mariusa closed 5 years ago

mariusa commented 5 years ago

Hola,

v2.0.1 returns null as timezones for RO country. https://www.timeanddate.com/time/zone/romania

mariusa commented 5 years ago

I've found the bug. Because there's no single API call to get both country name and countries, I was doing

    country = ct.getCountry('RO')
    country.timezones = ct.getTimezonesForCountry('RO')

Looks like ct.getCountry() returns object by reference, which means that it breaks when one overwrites the .timezones property. You might want to return a copy instead? If not, that's ok, at least this is known.

manuelmhtr commented 5 years ago

Hi @mariusa , You are right! It was a bug. It's now solved in v2.0.2.