From 40c41756b5bc5eea5039ccd46ef218278ed428a7 Mon Sep 17 00:00:00 2001 From: wangling Date: Sun, 5 May 2024 22:07:41 -0500 Subject: [PATCH] fix: minor error --- app/api/src/biz/exercise.js | 2 +- app/src/routes/WorkoutList.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/src/biz/exercise.js b/app/api/src/biz/exercise.js index 33dca20..5c70296 100644 --- a/app/api/src/biz/exercise.js +++ b/app/api/src/biz/exercise.js @@ -90,7 +90,7 @@ async function AddCalorieLog(userId, exerciseId) { async function GetCalorieLogs(userId, dateStr) { const startTime = new Date(dateStr); let endTime = new Date(dateStr); - endTime.setHours(endTime.getHours() + 24); + endTime.setDate(endTime.getDate()+1); const logs = await FindFromMongo(collectionCalorieLog, {userId: userId, createdAt: {$gte: startTime, $lt: endTime}}); return logs; } diff --git a/app/src/routes/WorkoutList.jsx b/app/src/routes/WorkoutList.jsx index 1965a0e..a95b7f0 100644 --- a/app/src/routes/WorkoutList.jsx +++ b/app/src/routes/WorkoutList.jsx @@ -56,7 +56,7 @@ function WorkoutList({ fetchTrigger }) { const updatedWorkout = { title: editFormData.title, description: editFormData.description, - calories: editFormData.calories + calories: parseInt(editFormData.calories) }; try {