From 75e088be24dc16dcb7b4053f86bb0f582903c04d Mon Sep 17 00:00:00 2001 From: sajdkabir Date: Fri, 1 Nov 2024 18:03:24 +0530 Subject: [PATCH] fix: this week --- apps/backend/src/services/lib/item.service.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/backend/src/services/lib/item.service.js b/apps/backend/src/services/lib/item.service.js index f08eda34f..26d339c7e 100644 --- a/apps/backend/src/services/lib/item.service.js +++ b/apps/backend/src/services/lib/item.service.js @@ -72,15 +72,13 @@ const getThisWeekItemsByDateRange = async (me, startDate, endDate) => { endDate = new Date(endDate); endDate.setUTCHours(23, 59, 59, 999); - console.log("startDate (UTC): ", startDate); - console.log("endDate (UTC): ", endDate); - const items = await Item.find({ user: me, isArchived: false, isDeleted: false, spaces: { $exists: true, $eq: [] }, - cycleDate: { $gte: startDate, $lte: endDate } + "cycle.startsAt": { $gte: startDate }, + "cycle.endsAt": { $lte: endDate } }) .sort({ createdAt: 1 });