Skip to content
Snippets Groups Projects
Commit ad500182 authored by Roger Braun's avatar Roger Braun
Browse files

Oh no! More datetime fixes!

parent 14b4029b
Branches
Tags
No related merge requests found
......@@ -158,7 +158,7 @@ def notifications(%{assigns: %{user: user}} = conn, params) 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})}
......
......@@ -29,7 +29,7 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity}
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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment