Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shahbaz-rao committed Jun 14, 2022
1 parent 1f838f0 commit 7346a15
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 16 additions & 3 deletions backend/controllers/attendance_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -839,10 +839,23 @@ module.exports.GetLastReport = (req, res) => {
}
]
}
},
{
'$addFields': {
'HOUR': {
'$divide': [
{
'$subtract': [
'$TakenOut', '$TakenIn'
]
}, 3600000
]
}
}
}, {
'$addFields': {
'TotalHours': {
'$sum': '$HOUR'
'$addFields': {
'TotalHours': {
'$sum': '$HOUR'
},
'WorkingHours': {
'$sum': '$WorkingHours'
Expand Down
2 changes: 1 addition & 1 deletion login_app/lib/pages/monthly_attendance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
(list['TakenOut'] != null) ?
'${DateFormat('dd-MM-yyyy h:mma').format(DateTime.parse(list['TakenOut'].toString()).toLocal())}' : "--"
)),
DataCell(Text(list['TotalHours'].toString())),
DataCell(Text(list['TotalHours'].toStringAsFixed(2))),
]))
.toList();
}
Expand Down

0 comments on commit 7346a15

Please sign in to comment.