Skip to content

Commit

Permalink
undo incorrectly applied timezone offset in clientside scripts (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
liamwhite committed Dec 3, 2020
1 parent aaf0454 commit 015fbb9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/philomena_web/views/image_view.ex
Expand Up @@ -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)),
Expand All @@ -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,
Expand Down

0 comments on commit 015fbb9

Please sign in to comment.