Format dates using CommonAPI utils.
authorPhil Hagelberg <phil@hagelb.org>
Wed, 30 Oct 2019 04:09:05 +0000 (21:09 -0700)
committerPhil Hagelberg <phil@hagelb.org>
Sun, 10 Nov 2019 02:07:50 +0000 (18:07 -0800)
lib/pleroma/web/static_fe/static_fe_view.ex
lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex

index 1194b7ecc12a2bb587c056cb093eff9c23cdd32a..c19aa07e1d4c0c08062884e8dc4e55037bffd84c 100644 (file)
@@ -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
index d1daa281c5c8eb92818331aa31fdfedc4007e072..9841fcf8469309436af7deb20151a102eb096ec8 100644 (file)
@@ -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">