I’ve just published Astro 1.1.0 with the following changelog entry. Please note the breaking change to configuration (there are no breaking changes to application code).
Breaking Change
-
:tz_world
is no longer a required dependency - it is now an optional dependency. This library is used to resolve a time zone name from a given latitude and longitude. When configured, it becomes the default method of resolving time zone names from a location. However it is no possible to provide alternative implementations for this resolution using the:time_zone_resolver
option. -
To retain the previous behaviour, applications should add
{:tz_world, "~> 1.0"}
to their dependencies.
Enhancements
-
Adds an option
:time_zone_resolver
toAstro.sunrise/3
andAstro.sunset/3
that is a 1-arity function that is invoked to resolve the time zone name from a given latitude and longitude. The default is to useTzWorld.timezone_at/1
ifTzWorld
is configured, otherwise an error is returned. -
The default time zone database is now detected in the following order:
- Application.get_env(:elixir, :time_zone_database)
- TzData.TimeZoneDatabase if TzData is configured
- Tz.TimeZoneDatabase if Tz is configured
Thanks to @cloud8421 for the motivation and encouragement to get this done.