fix: display deploy timestamp in user's timezone in footer

This commit is contained in:
Graham McIntire 2026-01-18 12:20:59 -06:00
parent d2e38e351e
commit 3dc22b118d
No known key found for this signature in database

View file

@ -68,7 +68,7 @@ defmodule ToweropsWeb.Layouts do
</div>
</main>
<.footer />
<.footer timezone={assigns[:timezone] || "UTC"} />
</div>
<.flash_group flash={@flash} />
@ -252,7 +252,7 @@ defmodule ToweropsWeb.Layouts do
</div>
</main>
<.footer />
<.footer timezone={assigns[:timezone] || "UTC"} />
</div>
<.flash_group flash={@flash} />
@ -423,7 +423,7 @@ defmodule ToweropsWeb.Layouts do
</div>
</main>
<.footer />
<.footer timezone={assigns[:timezone] || "UTC"} />
</div>
<.flash_group flash={@flash} />
@ -433,6 +433,8 @@ defmodule ToweropsWeb.Layouts do
@doc """
Renders the application footer with copyright notice and deploy timestamp.
"""
attr :timezone, :string, default: "UTC"
def footer(assigns) do
alias ToweropsWeb.TimeHelpers
@ -442,7 +444,7 @@ defmodule ToweropsWeb.Layouts do
assigns
|> assign(:build_time, build_time)
|> assign(:time_ago, TimeHelpers.format_time_ago(build_time))
|> assign(:formatted_time, TimeHelpers.format_iso8601(build_time))
|> assign(:formatted_time, TimeHelpers.format_iso8601(build_time, assigns[:timezone] || "UTC"))
~H"""
<footer class="border-t border-zinc-200 bg-white dark:border-zinc-800 dark:bg-zinc-900">