Fix backend tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-10-12 08:49:12 +02:00
parent 9621caf661
commit b383d11f51
7 changed files with 13 additions and 2 deletions

View File

@@ -496,7 +496,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Event do
physical_address when is_map(physical_address) ->
TimezoneDetector.detect(
timezone,
physical_address.geom,
Map.get(physical_address, :geom),
fallback_tz
)

View File

@@ -8,7 +8,9 @@ defmodule Mobilizon.Service.TimezoneDetector do
@doc """
Detect the most appropriate timezone from a value, a geographic set of coordinates and a fallback
"""
@spec detect(String.t() | nil, detectable(), String.t()) :: String.t()
@spec detect(String.t() | nil, detectable() | nil, String.t()) :: String.t()
def detect(tz, nil, fallback), do: detect(tz, fallback)
def detect(nil, geo, fallback) do
case TzWorld.timezone_at(geo) do
{:ok, timezone} ->