Oh no! More datetime fixes!
authorRoger Braun <rbraun@Bobble.local>
Wed, 13 Sep 2017 15:18:08 +0000 (17:18 +0200)
committerRoger Braun <rbraun@Bobble.local>
Wed, 13 Sep 2017 15:18:08 +0000 (17:18 +0200)
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
lib/pleroma/web/mastodon_api/views/status_view.ex

index 3f0c7407f756b1262faf49115bed16863d6d1e9e..14f7eeeb6c08bed06482a49d7d0a726a3f8a7543 100644 (file)
@@ -158,7 +158,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
     result = Enum.map(notifications, fn (%{id: id, activity: activity, inserted_at: created_at}) ->
       actor = User.get_cached_by_ap_id(activity.data["actor"])
       created_at = NaiveDateTime.to_iso8601(created_at)
-      |> String.replace(~r/\.\d+$/, ".000Z")
+      |> String.replace(~r/(\.\d+)?$/, ".000Z", global: false)
       case activity.data["type"] do
         "Create" ->
           %{id: id, type: "mention", created_at: created_at, account: AccountView.render("account.json", %{user: actor}), status: StatusView.render("status.json", %{activity: activity})}
index 16ed7bd559e0f8847ecc7efe7f238a3f79d365c2..a172875df320f9087208ba9ac15004c273bde98b 100644 (file)
@@ -29,7 +29,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
     created_at = (object["published"] || "")
     |> NaiveDateTime.from_iso8601!
     |> NaiveDateTime.to_iso8601
-    |> String.replace(~r/\.\d+$/, ".000Z")
+    |> String.replace(~r/(\.\d+)?$/, ".000Z", global: false)
 
     %{
       id: activity.id,