feat: add timezone handling
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/promote/production Build is failing

This commit is contained in:
Simon 2026-03-13 18:22:12 +01:00
parent 349cee0ce6
commit e8ec620d57
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
13 changed files with 128 additions and 28 deletions

View file

@ -63,7 +63,7 @@ defmodule MvWeb.JoinRequestLive.Index do
>
<:col :let={req} label={gettext("Submitted at")}>
<%= if req.submitted_at do %>
{DateFormatter.format_datetime(req.submitted_at)}
{DateFormatter.format_datetime(req.submitted_at, @browser_timezone)}
<% else %>
<.empty_cell sr_text={gettext("Not submitted yet")} />
<% end %>
@ -125,7 +125,7 @@ defmodule MvWeb.JoinRequestLive.Index do
</.badge>
</:col>
<:col :let={req} label={gettext("Reviewed at")}>
{review_date(req)}
{review_date(req, @browser_timezone)}
</:col>
<:col :let={req} label={gettext("Review by")}>
{JoinRequestHelpers.reviewer_display(req) || ""}
@ -162,7 +162,7 @@ defmodule MvWeb.JoinRequestLive.Index do
assign(socket, :page_title, gettext("Join requests"))
end
defp review_date(req) do
defp review_date(req, timezone) do
date =
case req.status do
:approved -> req.approved_at
@ -170,6 +170,6 @@ defmodule MvWeb.JoinRequestLive.Index do
_ -> nil
end
if date, do: DateFormatter.format_datetime(date), else: ""
if date, do: DateFormatter.format_datetime(date, timezone), else: ""
end
end