fix(i18n): preserve literal calendar dates in offer comparisons

This commit is contained in:
cesnimda
2026-11-04 01:58:27 +01:00
parent 09904ecc68
commit df0ef68cd9
6 changed files with 52 additions and 10 deletions
@@ -18,7 +18,7 @@ export default function OfferComparisonPage() {
const retryPending = useRef(false);
const loading = resource.loading || resource.refreshing;
const locale = language === "nb" ? "nb-NO" : "en";
const date = (value?: string | null) => value ? new Date(value).toLocaleDateString(locale) : "—";
const date = (value?: string | null) => value ? new Date(value).toLocaleDateString(locale, /^\d{4}-\d{2}-\d{2}$/.test(value) ? { timeZone: "UTC" } : undefined) : "—";
const periods = new Map([["year", t("salaryPeriodYear")], ["month", t("salaryPeriodMonth")], ["hour", t("salaryPeriodHour")]]);
return (