Parcourir la source

Truncate displayed date

theenglishway (time) il y a 4 ans
Parent
commit
fbb44ccb2c
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      lib/vaccins/location_store.ex

+ 1 - 0
lib/vaccins/location_store.ex

@@ -26,6 +26,7 @@ defmodule Vaccins.LocationStore do
         case result |> provider.analyze_result() do
           {:ok, slots} ->
             case slots
+                 |> Enum.map(&DateTime.truncate(&1, :second))
                  |> Enum.group_by(&(&1 |> DateTime.diff(DateTime.utc_now()) |> abs < @limit)) do
               grouped = %{true: before_limit} ->
                 {:ok, before_limit |> sort, grouped |> Map.get(false, []) |> sort}