Skip to content

Commit

Permalink
Merge pull request #78 from Rushikesh-Sonawane99/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #PS-1460 feat: Implemented Attendance tracking of newly added learner on dashboard and attendance history page
  • Loading branch information
itsvick authored Aug 2, 2024
2 parents 56c893f + 96c56de commit 0871334
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
19 changes: 13 additions & 6 deletions src/components/MarkBulkAttendance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,18 @@ const MarkBulkAttendance: React.FC<MarkBulkAttendanceProps> = ({
});
const resp = response?.result?.userDetails;
if (resp) {
const nameUserIdArray = resp?.map((entry: any) => ({
userId: entry.userId,
name: toPascalCase(entry.name),
memberStatus: entry.status,
}));
let nameUserIdArray = resp
.map((entry: any) => ({
userId: entry.userId,
name: toPascalCase(entry.name),
memberStatus: entry.status,
createdAt: entry.createdAt,
}))
.filter((member: { createdAt: string | number | Date }) => {
const createdAt = new Date(member.createdAt);
return createdAt <= selectedDate;
});

if (nameUserIdArray && selectedDate) {
const formatSelectedDate = shortDateFormat(selectedDate);
const userAttendanceStatusList = async () => {
Expand Down Expand Up @@ -227,7 +234,7 @@ const MarkBulkAttendance: React.FC<MarkBulkAttendanceProps> = ({
});
}
});
if (newArray.length != 0) {
if (newArray.length !== 0) {
setNumberOfCohortMembers(newArray?.length);
setCohortMemberList(newArray);
const hasDropout = newArray.some(
Expand Down
8 changes: 6 additions & 2 deletions src/pages/attendance-history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ const UserAttendanceHistory = () => {
const nameUserIdArray = resp?.map((entry: any) => ({
userId: entry.userId,
name: toPascalCase(entry.name),
memberStatus: entry.status,
}));
memberStatus: entry.status,createdAt: entry.createdAt,
}))
.filter((member: { createdAt: string | number | Date }) => {
const createdAt = new Date(member.createdAt);
return createdAt <= selectedDate;
});
if (nameUserIdArray && (selectedDate || currentDate)) {
const userAttendanceStatusList = async () => {
const attendanceStatusData: AttendanceStatusListProps = {
Expand Down

0 comments on commit 0871334

Please sign in to comment.