From 015fbb98ea2a27b18d053e86ca07f5d903c98e16 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Wed, 2 Dec 2020 19:03:35 -0500 Subject: [PATCH] undo incorrectly applied timezone offset in clientside scripts (fixes philomena-dev/philomena#75) --- lib/philomena_web/views/image_view.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/philomena_web/views/image_view.ex b/lib/philomena_web/views/image_view.ex index 9015ce55..af70585f 100644 --- a/lib/philomena_web/views/image_view.ex +++ b/lib/philomena_web/views/image_view.ex @@ -124,6 +124,8 @@ defmodule PhilomenaWeb.ImageView do end def image_container_data(conn, image, size) do + time = DateTime.from_naive!(image.created_at, "Etc/UTC") + [ image_id: image.id, image_tags: Jason.encode!(Enum.map(image.tags, & &1.id)), @@ -134,7 +136,7 @@ defmodule PhilomenaWeb.ImageView do upvotes: image.upvotes_count, downvotes: image.downvotes_count, comment_count: image.comments_count, - created_at: NaiveDateTime.to_iso8601(image.created_at), + created_at: DateTime.to_iso8601(time), source_url: image.source_url, uris: Jason.encode!(thumb_urls(image, can?(conn, :show, image))), width: image.image_width,