Convert multiple map values conditionally

def update_existing(map, key, fun) do
  case map do
    %{^key => old} -> %{map | key => fun.(old)}
    _ -> map
  end
end

def update_indifferent(map, key, fun) when is_atom(key) do
  map
  |> update_existing(key, fun)
  |> update_existing(Atom.to_string(key), fun)
end

And then

params
|> update_indifferent(:start_time, &CalendarUtils.from_iso8601/1)
|> update_indifferent(:end_time, &CalendarUtils.from_iso8601/1)