diff --git a/backend/controllers/attendance_controller.js b/backend/controllers/attendance_controller.js index 6293268..afa9e28 100644 --- a/backend/controllers/attendance_controller.js +++ b/backend/controllers/attendance_controller.js @@ -790,11 +790,17 @@ module.exports.GetLastReport = (req, res) => { if(req.body.StartDate) { startDate = new Date(req.body.StartDate) } - else { - startDate = new Date(new Date().setDate(1)) + // else { + // startDate = new Date(new Date().setDate(1)) + // } + if(req.body.EndDate) { + endDate = new Date(req.body.EndDate) } - if(req.body.EndDate) endDate = new Date(req.body.EndDate) - else endDate = new Date(new Date().setDate(30)) + // else { + // endDate = new Date(new Date().setDate(30)) + // } + console.log("startDate ",startDate) + console.log("endDate ",endDate) const reportagg = [ { '$match': { diff --git a/frontend/src/pages/ImIn.js b/frontend/src/pages/ImIn.js index 8a663be..94d2f4d 100644 --- a/frontend/src/pages/ImIn.js +++ b/frontend/src/pages/ImIn.js @@ -102,8 +102,7 @@ export default function ImIn() { user = JSON.parse(user); if (user.data?.data && user.data?.data?._id) { if (response.data?.data?.find(usr => usr.UserID === user.data?.data?._id)) { - - setButton("I am out") + setButton("i am Out") } } } @@ -134,7 +133,7 @@ export default function ImIn() { { headers: { "Authorization": `${token}` } } ) .then(function (response) { - console.log(response.data.message, "Response") + console.log(response.data, "Response") if (response.data.status === true) { SetMessage({ value: response.data.message, type: "success" }) setButton("i am Out")