From b13f9560991705c8d974c80b67dfc3dbb3ad90fe Mon Sep 17 00:00:00 2001 From: aleksei Date: Mon, 8 Jun 2026 16:32:51 +0300 Subject: [PATCH] =?UTF-8?q?fix(calendar):=20isoDay=20use=20local=20date=20?= =?UTF-8?q?parts=20=E2=80=94=20fixes=20MSK=20off-by-one=20day=20grouping?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/CalendarView.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/CalendarView.js b/components/CalendarView.js index 65b1d45..1d2f40c 100644 --- a/components/CalendarView.js +++ b/components/CalendarView.js @@ -57,7 +57,11 @@ function formatDate(iso) { } function isoDay(date) { - return date.toISOString().slice(0, 10); + // Ключ локального дня (НЕ UTC) — иначе в МСК события смещаются на день + const y = date.getFullYear(); + const m = String(date.getMonth() + 1).padStart(2, '0'); + const d = String(date.getDate()).padStart(2, '0'); + return `${y}-${m}-${d}`; } // ── EventCard ────────────────────────────────────────────────────────────────