Skip to content

Commit

Permalink
app currently correctly displays todays exercise list only
Browse files Browse the repository at this point in the history
  • Loading branch information
flbarfield committed Oct 16, 2023
1 parent 8785d32 commit 4b0b1e7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions controllers/fitnessApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ module.exports = {
console.log(req.user)

try {
const now = moment()
const endOfDay = now.endOf('day').toString()
const startOfDay = now.startOf('day').toString()

const exerciseItems = await Exercises.find({$and: [
{userId: req.user.id},
{date: {'$gte': new Date(),
'$lt': new Date()}
{date: {'$gte': startOfDay,
'$lt': endOfDay}

}]})

Expand Down

0 comments on commit 4b0b1e7

Please sign in to comment.