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 = (