srawlins / timezone

Time zone database and time zone aware DateTime object for Dart.
BSD 2-Clause "Simplified" License
101 stars 52 forks source link

[iOS] Missing timezone ? #175

Open matureck opened 1 year ago

matureck commented 1 year ago

I was try few things with the package (on an Iphone device) with which a faced an issue that is a bit annoying. In iOS 16.1.1 settings (General > Date & Time > Time Zone) I've founded this Tz : Australia/Canberra, tried it and as soon as I use the package, my App simply crash.

After verification, the v0.9.0 of the package is based on IANA 2022c where I couldn't find such a Tz.

Do someone know if this issue came from the package, IANA db or iOS Tz list ?

Or even a solution to this problem, by the way I didn't checked if any other Tz in iOS settings make the package crash.

thumbert commented 1 year ago

If you take a look at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones it looks like Australia/Canberra is linked to Australia/Sydney. That's probably why getLocation('Australia/Canberra') throws. You will need to wrap it into a try/catch and direct the user to choose another location.