diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 4140c538..b4113834 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -139,7 +139,7 @@ "NO_CENTER_FOUND": "No Center found", "FILTER_BY": "Filter By", "ALL": "All", - "ACTIVE": "Active" + "NOW": "Now" }, "LOGIN_PAGE": { "USERNAME": "Username", diff --git a/src/pages/attendance-history.tsx b/src/pages/attendance-history.tsx index 4a902c0f..8a207307 100644 --- a/src/pages/attendance-history.tsx +++ b/src/pages/attendance-history.tsx @@ -114,11 +114,12 @@ const UserAttendanceHistory = () => { const attendanceInfo = { present_students: data.presentCount, totalcount: data.numberOfCohortMembers, - present_percentage: ( - (data.presentCount / data.numberOfCohortMembers) * - 100 - ).toFixed(2), + present_percentage: + data.numberOfCohortMembers === 0 + ? "0" + : `${((data.presentCount / data.numberOfCohortMembers) * 100).toFixed(2)}`, }; + setAttendanceProgressBarData({ [shortDateFormat(selectedDate)]: attendanceInfo,