From 5d5ccf406d8b489fed6e7f04cfa84eb5d53a2f6d Mon Sep 17 00:00:00 2001 From: perco Date: Tue, 12 May 2026 15:06:28 +0200 Subject: [PATCH] Fix cron: notify tasks with due_time but no due_date (treat as today) Co-Authored-By: Claude Sonnet 4.6 --- cron/todo_notify.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cron/todo_notify.php b/cron/todo_notify.php index 3123b88..250fa02 100644 --- a/cron/todo_notify.php +++ b/cron/todo_notify.php @@ -60,14 +60,15 @@ foreach ($families as $family_id) { $webhook = $ws->fetchColumn(); if (!$webhook) continue; - // Tasks due now: due today, due_time reached, not done, not yet notified + // Tasks due now: due_time reached, not done, not yet notified + // Handles: date+time, time only (null date = today), overdue with time $stmt = $pdo->prepare(" SELECT t.id, t.title, t.due_date, t.due_time, l.name AS list_name, l.icon AS list_icon FROM pf_todos t LEFT JOIN pf_todo_lists l ON l.id = t.list_id - WHERE t.due_date = CURDATE() - AND t.due_time IS NOT NULL + WHERE t.due_time IS NOT NULL + AND (t.due_date IS NULL OR t.due_date <= CURDATE()) AND t.due_time <= CURTIME() AND t.done = 0 AND t.notified = 0