mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +01:00
undo incorrectly applied timezone offset in clientside scripts (fixes philomena-dev/philomena#75)
This commit is contained in:
parent
aaf04544b6
commit
015fbb98ea
1 changed files with 3 additions and 1 deletions
|
@ -124,6 +124,8 @@ defmodule PhilomenaWeb.ImageView do
|
||||||
end
|
end
|
||||||
|
|
||||||
def image_container_data(conn, image, size) do
|
def image_container_data(conn, image, size) do
|
||||||
|
time = DateTime.from_naive!(image.created_at, "Etc/UTC")
|
||||||
|
|
||||||
[
|
[
|
||||||
image_id: image.id,
|
image_id: image.id,
|
||||||
image_tags: Jason.encode!(Enum.map(image.tags, & &1.id)),
|
image_tags: Jason.encode!(Enum.map(image.tags, & &1.id)),
|
||||||
|
@ -134,7 +136,7 @@ defmodule PhilomenaWeb.ImageView do
|
||||||
upvotes: image.upvotes_count,
|
upvotes: image.upvotes_count,
|
||||||
downvotes: image.downvotes_count,
|
downvotes: image.downvotes_count,
|
||||||
comment_count: image.comments_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,
|
source_url: image.source_url,
|
||||||
uris: Jason.encode!(thumb_urls(image, can?(conn, :show, image))),
|
uris: Jason.encode!(thumb_urls(image, can?(conn, :show, image))),
|
||||||
width: image.image_width,
|
width: image.image_width,
|
||||||
|
|
Loading…
Reference in a new issue