Render timestamps as dates
No need for time precision in the UI
This commit is contained in:
@@ -52,4 +52,8 @@ defmodule MusicLibraryWeb.RecordLive.Show do
|
||||
defp musicbrainz_url(record) do
|
||||
"https://musicbrainz.org/release-group/#{record.musicbrainz_id}"
|
||||
end
|
||||
|
||||
defp human_datetime(dt) do
|
||||
"#{dt.day}/#{dt.month}/#{dt.year}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<%= gettext("Purchased on") %>
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-6 text-zinc-700 dark:text-zinc-300 sm:col-span-2 sm:mt-0">
|
||||
<%= @record.purchased_at %>
|
||||
<%= human_datetime(@record.purchased_at) %>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
|
||||
@@ -75,7 +75,7 @@
|
||||
<%= gettext("Inserted at") %>
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-6 text-zinc-700 dark:text-zinc-300 sm:col-span-2 sm:mt-0">
|
||||
<%= @record.inserted_at %>
|
||||
<%= human_datetime(@record.inserted_at) %>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
|
||||
@@ -83,7 +83,7 @@
|
||||
<%= gettext("Updated at") %>
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-6 text-zinc-700 dark:text-zinc-300 sm:col-span-2 sm:mt-0">
|
||||
<%= @record.updated_at %>
|
||||
<%= human_datetime(@record.updated_at) %>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
@@ -52,4 +52,8 @@ defmodule MusicLibraryWeb.WishlistLive.Show do
|
||||
defp musicbrainz_url(record) do
|
||||
"https://musicbrainz.org/release-group/#{record.musicbrainz_id}"
|
||||
end
|
||||
|
||||
defp human_datetime(dt) do
|
||||
"#{dt.day}/#{dt.month}/#{dt.year}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<%= gettext("Inserted at") %>
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-6 text-zinc-700 dark:text-zinc-300 sm:col-span-2 sm:mt-0">
|
||||
<%= @record.inserted_at %>
|
||||
<%= human_datetime(@record.inserted_at) %>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
|
||||
@@ -75,7 +75,7 @@
|
||||
<%= gettext("Updated at") %>
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-6 text-zinc-700 dark:text-zinc-300 sm:col-span-2 sm:mt-0">
|
||||
<%= @record.updated_at %>
|
||||
<%= human_datetime(@record.updated_at) %>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
Reference in New Issue
Block a user