2020-01-26 21:36:50 +01:00
|
|
|
defmodule Mobilizon.Web.EmailView do
|
|
|
|
use Mobilizon.Web, :view
|
2019-09-30 18:18:04 +02:00
|
|
|
|
2020-01-26 21:36:50 +01:00
|
|
|
import Mobilizon.Web.Gettext
|
2019-10-01 13:08:09 +02:00
|
|
|
|
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
|