4.8.8: Бесконечные задачи в completed
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m20s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m20s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "play-life-web",
|
||||
"version": "4.8.7",
|
||||
"version": "4.8.8",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -455,21 +455,24 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry
|
||||
|
||||
// Определяем, в какую группу попадает задача
|
||||
let isCompleted = false
|
||||
let isInfinite = false
|
||||
|
||||
// Используем только next_show_at для группировки
|
||||
if (task.next_show_at) {
|
||||
// Сначала проверяем, является ли задача бесконечной
|
||||
// Бесконечная задача: repetition_period == 0 И (repetition_date == 0 ИЛИ отсутствует)
|
||||
// Для обратной совместимости: если repetition_period = 0, считаем бесконечной
|
||||
const hasZeroPeriod = task.repetition_period && isZeroPeriod(task.repetition_period)
|
||||
const hasZeroDate = task.repetition_date && isZeroDate(task.repetition_date)
|
||||
// Идеально: оба поля = 0, но для старых задач может быть только repetition_period = 0
|
||||
const isInfinite = (hasZeroPeriod && hasZeroDate) || (hasZeroPeriod && !task.repetition_date)
|
||||
|
||||
// Бесконечные задачи всегда идут в completed, независимо от next_show_at
|
||||
if (isInfinite) {
|
||||
isCompleted = true
|
||||
} else if (task.next_show_at) {
|
||||
// Для обычных задач используем next_show_at для группировки
|
||||
const nextShowDate = new Date(task.next_show_at)
|
||||
nextShowDate.setHours(0, 0, 0, 0)
|
||||
isCompleted = nextShowDate.getTime() > today.getTime()
|
||||
isInfinite = false
|
||||
} else {
|
||||
// Бесконечная задача: repetition_period == 0 И (repetition_date == 0 ИЛИ отсутствует)
|
||||
// Для обратной совместимости: если repetition_period = 0, считаем бесконечной
|
||||
const hasZeroPeriod = task.repetition_period && isZeroPeriod(task.repetition_period)
|
||||
const hasZeroDate = task.repetition_date && isZeroDate(task.repetition_date)
|
||||
// Идеально: оба поля = 0, но для старых задач может быть только repetition_period = 0
|
||||
isInfinite = (hasZeroPeriod && hasZeroDate) || (hasZeroPeriod && !task.repetition_date)
|
||||
isCompleted = false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user