Use time with datetime for scrobble at element

This commit is contained in:
Claudio Ortolina
2024-11-06 12:39:41 +00:00
parent 26064cd15a
commit 0c72fe4bbc
2 changed files with 11 additions and 2 deletions
@@ -62,4 +62,10 @@ defmodule MusicLibraryWeb.StatsLive.Index do
_other -> "" _other -> ""
end end
end end
defp format_scrobbled_at_uts(uts) do
uts
|> DateTime.from_unix!()
|> DateTime.to_iso8601()
end
end end
@@ -89,9 +89,12 @@
<%= track.title %> <%= track.title %>
</p> </p>
</div> </div>
<div class="whitespace-nowrap text-right text-xs sm:text-sm text-zinc-500 dark:text-zinc-400"> <time
datetime={format_scrobbled_at_uts(track.scrobbled_at_uts)}
class="whitespace-nowrap text-right text-xs sm:text-sm text-zinc-500 dark:text-zinc-400"
>
<%= track.scrobbled_at_label %> <%= track.scrobbled_at_label %>
</div> </time>
</div> </div>
</div> </div>
</div> </div>