Enhance: Google Photos integration, refinement of Schedule/Todo lists and API fixes
This commit is contained in:
@@ -23,7 +23,18 @@ router.get("/", async (req, res) => {
|
||||
router.get("/today", async (req, res) => {
|
||||
try {
|
||||
const { start, end } = getDayRange();
|
||||
const todos = await Todo.find({ dueDate: { $gte: start, $lte: end } }).sort({
|
||||
// Include:
|
||||
// 1. Tasks due today
|
||||
// 2. Overdue tasks (due before today) that are not completed
|
||||
// 3. Tasks with no due date that are not completed
|
||||
const todos = await Todo.find({
|
||||
$or: [
|
||||
{ dueDate: { $gte: start, $lte: end } },
|
||||
{ dueDate: { $lt: start }, completed: false },
|
||||
{ dueDate: { $exists: false }, completed: false },
|
||||
{ dueDate: null, completed: false }
|
||||
]
|
||||
}).sort({
|
||||
dueDate: 1,
|
||||
createdAt: -1,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user