Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
shahbaz-rao committed Dec 7, 2022
2 parents 0ad304b + 7811b86 commit 3f23a8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
14 changes: 10 additions & 4 deletions backend/controllers/attendance_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/pages/ImIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
}
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 3f23a8f

Please sign in to comment.