From 6cc3e4308d6fda5d0cfa0a5319cb9c3c7f94541d Mon Sep 17 00:00:00 2001 From: sadamhussain Date: Tue, 14 Jun 2022 16:14:50 +0500 Subject: [PATCH] log start & end Dates --- backend/controllers/attendance_controller.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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': {