From 07c4deaf705bed40f20ac8194fcb3d47e008875e Mon Sep 17 00:00:00 2001 From: poignatov Date: Mon, 23 Feb 2026 12:29:19 +0300 Subject: [PATCH] =?UTF-8?q?5.3.0:=20=D0=9A=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0?= =?UTF-8?q?=20=C2=AB=D0=9F=D0=BE=20=D0=BF=D0=BB=D0=B0=D0=BD=D1=83=C2=BB,?= =?UTF-8?q?=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20=D1=87=D0=B8=D0=BF?= =?UTF-8?q?=D0=B0=20=C2=AB=D0=A1=D0=B5=D0=B3=D0=BE=D0=B4=D0=BD=D1=8F=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- play-life-web/package.json | 2 +- play-life-web/src/components/TaskList.jsx | 40 ++++++++++++++++++++--- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index ce7f2b4..03f488b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.2.2 +5.3.0 diff --git a/play-life-web/package.json b/play-life-web/package.json index f4b7692..5a85e94 100644 --- a/play-life-web/package.json +++ b/play-life-web/package.json @@ -1,6 +1,6 @@ { "name": "play-life-web", - "version": "5.2.2", + "version": "5.3.0", "type": "module", "scripts": { "dev": "vite", diff --git a/play-life-web/src/components/TaskList.jsx b/play-life-web/src/components/TaskList.jsx index 5d138c6..25fc4ac 100644 --- a/play-life-web/src/components/TaskList.jsx +++ b/play-life-web/src/components/TaskList.jsx @@ -429,12 +429,8 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry const handleDateSelect = (date) => { if (!date) return - - // Преобразуем дату в формат YYYY-MM-DD const formattedDate = formatDateToLocal(date) setPostponeDate(formattedDate) - - // Применяем дату и закрываем модальное окно if (selectedTaskForPostpone) { handlePostponeSubmitWithDate(formattedDate) } @@ -1108,6 +1104,31 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry const isToday = nextShowAtStr === todayStr const isTomorrow = nextShowAtStr === tomorrowStr + // Не показывать «Сегодня», если next_show_at уже сегодня или в прошлом + const showTodayChip = !nextShowAtStr || nextShowAtStr > todayStr + + // Дата "по плану" (repetition_date / repetition_period или завтра) + const task = selectedTaskForPostpone + let plannedDate + const now = new Date() + now.setHours(0, 0, 0, 0) + if (task.repetition_date) { + const nextDate = calculateNextDateFromRepetitionDate(task.repetition_date) + if (nextDate) plannedDate = nextDate + } else if (task.repetition_period && !isZeroPeriod(task.repetition_period)) { + const nextDate = calculateNextDateFromRepetitionPeriod(task.repetition_period) + if (nextDate) plannedDate = nextDate + } + if (!plannedDate) { + plannedDate = new Date(now) + plannedDate.setDate(plannedDate.getDate() + 1) + } + plannedDate.setHours(0, 0, 0, 0) + const plannedDateStr = formatDateToLocal(plannedDate) + const plannedNorm = plannedDateStr.slice(0, 10) + const nextShowNorm = nextShowAtStr ? String(nextShowAtStr).slice(0, 10) : '' + // Показываем кнопку, если текущий next_show_at не совпадает с датой по плану + const isCurrentDatePlanned = plannedNorm && nextShowNorm && plannedNorm === nextShowNorm const modalContent = (
@@ -1134,7 +1155,7 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry />
- {!isToday && ( + {showTodayChip && ( + )}