Add media upload endpoint.
[akkoma] / lib / pleroma / web / mastodon_api / views / status_view.ex
index 4a3ab7b505a1c730a64e7a8792cd5094fc3d03b6..a172875df320f9087208ba9ac15004c273bde98b 100644 (file)
@@ -27,7 +27,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
     attachments = render_many(object["attachment"] || [], StatusView, "attachment.json", as: :attachment)
 
     created_at = (object["published"] || "")
-    |> String.replace(~r/\.\d+Z/, ".000Z")
+    |> NaiveDateTime.from_iso8601!
+    |> NaiveDateTime.to_iso8601
+    |> String.replace(~r/(\.\d+)?$/, ".000Z", global: false)
 
     %{
       id: activity.id,