mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-23 16:33:28 +00:00
4144e9ffd0
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
19 lines
563 B
Elixir
19 lines
563 B
Elixir
defmodule Mobilizon.Web.EmailView do
|
|
use Mobilizon.Web, :view
|
|
|
|
import Mobilizon.Web.Gettext
|
|
|
|
def datetime_to_string(%DateTime{} = datetime, locale \\ "en", format \\ :medium) do
|
|
with {:ok, string} <-
|
|
Mobilizon.Cldr.DateTime.to_string(datetime, format: format, locale: locale) do
|
|
string
|
|
end
|
|
end
|
|
|
|
def datetime_to_time_string(%DateTime{} = datetime, locale \\ "en", format \\ :hm) do
|
|
with {:ok, string} <-
|
|
Mobilizon.Cldr.DateTime.to_string(datetime, format: format, locale: locale) do
|
|
string
|
|
end
|
|
end
|
|
end
|