Skip to content

Instantly share code, notes, and snippets.

@jeisenberg
Last active September 8, 2016 03:49
Show Gist options
  • Save jeisenberg/b855936f0d5582aaf09ccea1589f4b0c to your computer and use it in GitHub Desktop.
Save jeisenberg/b855936f0d5582aaf09ccea1589f4b0c to your computer and use it in GitHub Desktop.
def humanizing_operating_hours_with_pipes(hours_map) do
Enum.group_by(hours_map, fn(x) -> elem(x, 1) end, fn(x) -> elem(x,0) end)
|> Enum.into([])
|> Enum.map(fn(x) ->
v = elem(x, 1)
|> Enum.map(&(String.upcase(&1)))
|> Enum.join(", ")
end)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment