mobilizon.chapril.org-mobil.../lib/mobilizon_web/views/email_view.ex

11 lines
285 B
Elixir
Raw Normal View History

2019-09-17 02:45:32 +02:00
defmodule MobilizonWeb.EmailView do
use MobilizonWeb, :view
def datetime_to_string(%DateTime{} = datetime, locale \\ "en") do
with {:ok, string} <-
Cldr.DateTime.to_string(datetime, Mobilizon.Cldr, format: :medium, locale: locale) do
string
end
end
end