diff --git a/backend/app/routers/dashboard.py b/backend/app/routers/dashboard.py index 937dd82..b150b40 100644 --- a/backend/app/routers/dashboard.py +++ b/backend/app/routers/dashboard.py @@ -35,19 +35,21 @@ async def get_dashboard( events_result = await db.execute(events_query) todays_events = events_result.scalars().all() - # Upcoming todos (not completed, with due date within upcoming_days) + # Upcoming todos (not completed, with due date from today through upcoming_days) todos_query = select(Todo).where( Todo.completed == False, Todo.due_date.isnot(None), + Todo.due_date >= today, Todo.due_date <= upcoming_cutoff ).order_by(Todo.due_date.asc()) todos_result = await db.execute(todos_query) upcoming_todos = todos_result.scalars().all() - # Active reminders (not dismissed, is_active = true) + # Active reminders (not dismissed, is_active = true, from today onward) reminders_query = select(Reminder).where( Reminder.is_active == True, - Reminder.is_dismissed == False + Reminder.is_dismissed == False, + Reminder.remind_at >= today_start ).order_by(Reminder.remind_at.asc()) reminders_result = await db.execute(reminders_query) active_reminders = reminders_result.scalars().all()