Skip to content

Commit 3af41aa

Browse files
committed
fix(my-space): make OrdinalLongDate timezone-stable (#3207)
Addresses revu-bot review on #3280: `date.getDate()` and `toLocaleDateString` (no `timeZone` option) resolve in the runtime's local timezone, so a date stored at midnight UTC rendered on a UTC−N host could shift to the previous day — e.g. `2026-03-01T00:00:00Z` rendered as "28ᵉ février" instead of "1ᵉʳ mars". Switched to `getUTCDate()` + `Intl.DateTimeFormat("fr-FR", { …, timeZone: "UTC" })` so the displayed day is always derived from the stored UTC date.
1 parent 193e0c9 commit 3af41aa

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/app/src/modules/my-space/VerticalStepper.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,13 @@ function DeadlineRow({ date }: { date: Date }) {
417417
}
418418

419419
function OrdinalLongDate({ date }: { date: Date }) {
420-
const day = date.getDate();
420+
const day = date.getUTCDate();
421421
const suffix = day === 1 ? "er" : "e";
422-
const monthYear = date.toLocaleDateString("fr-FR", {
422+
const monthYear = new Intl.DateTimeFormat("fr-FR", {
423423
month: "long",
424424
year: "numeric",
425-
});
425+
timeZone: "UTC",
426+
}).format(date);
426427
return (
427428
<>
428429
{day}

0 commit comments

Comments
 (0)