theenglishway (time) 4 éve
szülő
commit
fda1aa1072
3 módosított fájl, 18 hozzáadás és 2 törlés
  1. 7 1
      lib/vaccins/queries.ex
  2. 2 1
      mix.exs
  3. 9 0
      mix.lock

+ 7 - 1
lib/vaccins/queries.ex

@@ -51,7 +51,13 @@ defmodule Vaccins.Queries do
        |> Enum.reject(&(&1.slots |> Enum.empty?()))
        |> Enum.map(& &1.slots)
        |> Enum.concat()
-       |> Enum.map(&(&1 |> Map.take([:start_date, :end_date])))}
+       |> Enum.map(& &1.start_date)
+       |> Enum.map(
+         &with {:ok, date, offset} <- &1 |> DateTime.from_iso8601(),
+               {:ok, converted} <-
+                 date |> DateTime.shift_zone("Europe/Paris", Tzdata.TimeZoneDatabase),
+               do: converted
+       )}
     end
   end
 end

+ 2 - 1
mix.exs

@@ -47,7 +47,8 @@ defmodule Vaccins.MixProject do
       {:finch, "~> 0.6"},
       {:ex2ms, "~> 1.0"},
       {:ecto, "~> 3.6"},
-      {:phoenix_ecto, "~> 4.1"}
+      {:phoenix_ecto, "~> 4.1"},
+      {:tzdata, "~> 1.1"}
     ]
   end
 

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 9 - 0
mix.lock