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

13 lines
319 B
Elixir
Raw Normal View History

2020-01-26 21:36:50 +01:00
defmodule Mobilizon.Web.EmailView do
use Mobilizon.Web, :view
2020-01-26 21:36:50 +01:00
import Mobilizon.Web.Gettext
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