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:
2026-09-16 00:49:23 +02:00
parent e299c66121
commit 618ef812e6
4 changed files with 21 additions and 9 deletions
+3 -2
View File
@@ -9,6 +9,7 @@ import { useConfirm } from "./ConfirmProvider";
import { notify } from "../lib/notifications";
import { notifyActionError } from "../lib/actionErrors";
import { copyText } from "../lib/clipboard";
import { formatDate } from "../lib/format";
import { api, type DownloadJob, type ShareLink } from "../lib/api";
import { inputCls } from "./ui/form";
import { Button } from "./ui/Button";
@@ -88,7 +89,7 @@ function UserShare({ job }: { job: DownloadJob }) {
// --- share by public link -------------------------------------------------------------------
function LinkRow({ link, onChanged }: { link: ShareLink; onChanged: () => void }) {
const { t } = useTranslation();
const { t, i18n } = useTranslation();
const confirm = useConfirm();
const [copied, setCopied] = useState(false);
const [editPass, setEditPass] = useState(false);
@@ -130,7 +131,7 @@ function LinkRow({ link, onChanged }: { link: ShareLink; onChanged: () => void }
if (link.allow_download) badges.push(t("downloads.share.downloadable"));
if (link.expires_at)
badges.push(
t("downloads.share.expiresOn", { date: new Date(link.expires_at).toLocaleDateString() }),
t("downloads.share.expiresOn", { date: formatDate(link.expires_at, i18n.language) }),
);
return (