diff --git a/backend/routes/todos.js b/backend/routes/todos.js index 1bcf37f..8818fa0 100644 --- a/backend/routes/todos.js +++ b/backend/routes/todos.js @@ -40,7 +40,7 @@ router.get("/today", async (req, res) => { // Show todos that are: // 1. Due today (between start and end of today) - both completed and incomplete // 2. Due in the future (not yet due) - only incomplete - // 3. Have no due date set - only incomplete + // 3. Have no due date set - both completed and incomplete (always show) // Filter out: overdue todos (due date before today) const todos = await Todo.find({ $or: [ @@ -48,9 +48,9 @@ router.get("/today", async (req, res) => { { dueDate: { $gte: start, $lte: end } }, // Future todos - only incomplete { dueDate: { $gt: end }, completed: false }, - // No due date - only incomplete - { dueDate: { $exists: false }, completed: false }, - { dueDate: null, completed: false } + // No due date - always show (completed or not) + { dueDate: { $exists: false } }, + { dueDate: null } ] }).sort({ completed: 1, // Incomplete first diff --git a/flutter_app/lib/services/todo_service.dart b/flutter_app/lib/services/todo_service.dart index 825ca7f..2d5d89f 100644 --- a/flutter_app/lib/services/todo_service.dart +++ b/flutter_app/lib/services/todo_service.dart @@ -39,8 +39,8 @@ class TodoService { // Future date - only show if incomplete return !todo.completed; } - // No due date - only show if incomplete - return !todo.completed; + // No due date - always show (completed or not) + return true; }).toList(); // Sort: incomplete first, then by due date