2019-09-17 02:45:32 +02:00
|
|
|
defmodule MobilizonWeb.EmailView do
|
2018-10-11 17:37:39 +02:00
|
|
|
use MobilizonWeb, :view
|
2019-09-30 18:18:04 +02:00
|
|
|
|
|
|
|
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
|
2018-10-11 17:37:39 +02:00
|
|
|
end
|