fix: dates follow the UI language, not the browser's
Seven sites formatted with a bare toLocaleString()/toLocaleDateString(), so an English UI on a Hungarian machine printed Hungarian-shaped dates (and the reverse). They now go through formatDateTime/formatDate, which take the i18n language.
This commit is contained in:
@@ -431,7 +431,7 @@ function PendingAccessRowView({
|
||||
{row.created_at && (
|
||||
<span>
|
||||
{t("users.pendingAccess.signedUp", {
|
||||
time: new Date(row.created_at).toLocaleString(),
|
||||
time: formatDateTime(row.created_at),
|
||||
})}
|
||||
</span>
|
||||
)}
|
||||
@@ -619,7 +619,10 @@ function AdminInvites() {
|
||||
inv.invited_at
|
||||
? "settings.invites.inviteConfirmAgain"
|
||||
: "settings.invites.inviteConfirm",
|
||||
{ email: inv.email, time: new Date(inv.invited_at ?? 0).toLocaleString() },
|
||||
{
|
||||
email: inv.email,
|
||||
time: formatDateTime(inv.invited_at ?? new Date(0).toISOString()),
|
||||
},
|
||||
)}
|
||||
</p>
|
||||
<InviteLangPicker initial={lang} onPick={(v) => (lang = v)} />
|
||||
@@ -718,7 +721,7 @@ function AdminInvites() {
|
||||
hint={
|
||||
i.invited_at
|
||||
? t("settings.invites.invitedAt", {
|
||||
time: new Date(i.invited_at).toLocaleString(),
|
||||
time: formatDateTime(i.invited_at),
|
||||
})
|
||||
: t("settings.invites.inviteHint")
|
||||
}
|
||||
@@ -916,7 +919,7 @@ function InviteRow({
|
||||
{inv.requested_at && (
|
||||
<div className="text-2xs text-muted">
|
||||
{t("settings.invites.requested", {
|
||||
time: new Date(inv.requested_at).toLocaleString(),
|
||||
time: formatDateTime(inv.requested_at),
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user