From 5b667f2f7a1e596aa19428029952b98997f30e42 Mon Sep 17 00:00:00 2001 From: Brian Berlin Date: Mon, 25 Sep 2023 16:33:47 -0500 Subject: [PATCH] Makes time_zone_database configurable --- lib/cocktail/time.ex | 2 +- mix.exs | 2 +- test/test_helper.exs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cocktail/time.ex b/lib/cocktail/time.ex index f95a57a..4813db5 100644 --- a/lib/cocktail/time.ex +++ b/lib/cocktail/time.ex @@ -340,6 +340,6 @@ defmodule Cocktail.Time do def parse(_, _), do: {:error, :invalid_format} defp get_time_zone_datebase do - Application.get_env(:elixir, :time_zone_database, Tzdata.TimeZoneDatabase) + Application.get_env(:elixir, :time_zone_database) end end diff --git a/mix.exs b/mix.exs index 87ae72e..8551fa3 100644 --- a/mix.exs +++ b/mix.exs @@ -81,7 +81,7 @@ defmodule Cocktail.Mixfile do {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.23", only: :dev, runtime: false}, {:excoveralls, "~> 0.10", only: :test}, - {:tzdata, "~> 1.1"} + {:tzdata, "~> 1.1", only: :test} ] end end diff --git a/test/test_helper.exs b/test/test_helper.exs index 580d1cc..18ff609 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -1,4 +1,4 @@ ExUnit.configure(exclude: [pending: true], formatters: [ExUnit.CLIFormatter, ExUnitNotifier]) ExUnit.start() - +Application.put_env(:elixir, :time_zone_database, Tzdata.TimeZoneDatabase) Code.require_file("test/support/datetime_sigil.ex")