diff options
author | Phil Hagelberg <phil@hagelb.org> | 2019-10-29 21:09:05 -0700 |
---|---|---|
committer | Phil Hagelberg <phil@hagelb.org> | 2019-11-09 18:07:50 -0800 |
commit | 93e9c0cedf0e2b4ab5966832cc912369c7aaf3ad (patch) | |
tree | 82c78cc0ebb9d2c6254558cb68953365ca4ac75a | |
parent | 918e1353f6bc7f6dfe317a87d942dfa2e53064af (diff) | |
download | pleroma-93e9c0cedf0e2b4ab5966832cc912369c7aaf3ad.tar.gz |
Format dates using CommonAPI utils.
-rw-r--r-- | lib/pleroma/web/static_fe/static_fe_view.ex | 5 | ||||
-rw-r--r-- | lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/pleroma/web/static_fe/static_fe_view.ex b/lib/pleroma/web/static_fe/static_fe_view.ex index 1194b7ecc..c19aa07e1 100644 --- a/lib/pleroma/web/static_fe/static_fe_view.ex +++ b/lib/pleroma/web/static_fe/static_fe_view.ex @@ -28,4 +28,9 @@ defmodule Pleroma.Web.StaticFE.StaticFEView do def fetch_media_type(%{"mediaType" => mediaType}) do Utils.fetch_media_type(@media_types, mediaType) end + + def format_date(date) do + {:ok, date, _} = DateTime.from_iso8601(date) + Pleroma.Web.CommonAPI.Utils.format_asctime(date) + end end diff --git a/lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex b/lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex index d1daa281c..9841fcf84 100644 --- a/lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex +++ b/lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex @@ -1,6 +1,6 @@ <div class="activity" <%= if @selected do %> id="selected" <% end %>> <p class="pull-right"> - <%= link @published, to: @link, class: "activity-link" %> + <%= link format_date(@published), to: @link, class: "activity-link" %> </p> <%= render("_user_card.html", %{user: @user}) %> <div class="activity-content"> |