Skip to content

Commit

Permalink
Issue #PS-0000 fix: Resolved issue future date cant be marked
Browse files Browse the repository at this point in the history
  • Loading branch information
itsvick committed Nov 23, 2024
1 parent fce7986 commit ae12833
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
5 changes: 2 additions & 3 deletions src/components/MonthCalender.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import 'react-calendar/dist/Calendar.css';

import Calendar, { CalendarProps } from 'react-calendar';
import {
CancelOutlined,
CheckCircleOutlineOutlined,
} from '@mui/icons-material';
import React, { useEffect, useState } from 'react';
import Calendar from 'react-calendar';
import { CircularProgressbar, buildStyles } from 'react-circular-progressbar';
import React, { useEffect, useRef, useState } from 'react';

import Value from 'react-calendar';
import { shortDateFormat } from '@/utils/Helper';
import useDeterminePathColor from '../hooks/useDeterminePathColor';
import useStore from '../store/store';
Expand Down
30 changes: 16 additions & 14 deletions src/pages/attendance-history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,29 @@ import {
} from '@mui/material';
import React, { useEffect, useRef, useState } from 'react';
import {
AttendanceParams,
AttendancePercentageProps,
AttendanceStatusListProps,
ICohort,
CohortMemberList,
user,
ICohort,
user
} from '../utils/Interfaces';

import { fetchAttendanceDetails } from '@/components/AttendanceDetails';
import AttendanceStatus from '@/components/AttendanceStatus';
import AttendanceStatusListView from '@/components/AttendanceStatusListView';
import CohortSelectionSection from '@/components/CohortSelectionSection';
import NoDataFound from '@/components/common/NoDataFound';
import MarkBulkAttendance from '@/components/MarkBulkAttendance';
import MonthCalender from '@/components/MonthCalender';
import { showToastMessage } from '@/components/Toastify';
import UpDownButton from '@/components/UpDownButton';
import { getMyCohortMemberList } from '@/services/MyClassDetailsService';
import useStore from '@/store/store';
import { Status, Telemetry } from '@/utils/app.constant';
import { calculatePercentage } from '@/utils/attendanceStats';
import { logEvent } from '@/utils/googleAnalytics';
import withAccessControl from '@/utils/hoc/withAccessControl';
import { telemetryFactory } from '@/utils/telemetry';
import ArrowDropDownSharpIcon from '@mui/icons-material/ArrowDropDownSharp';
import ClearIcon from '@mui/icons-material/Clear';
import KeyboardBackspaceOutlinedIcon from '@mui/icons-material/KeyboardBackspaceOutlined';
Expand All @@ -51,12 +54,8 @@ import { accessControl } from '../../app.config';
import Header from '../components/Header';
import Loader from '../components/Loader';
import SortingModal from '../components/SortingModal';
import { attendanceStatusList } from '../services/AttendanceService';
import { telemetryFactory } from '@/utils/telemetry';
import NoDataFound from '@/components/common/NoDataFound';
import { fetchAttendanceDetails } from '@/components/AttendanceDetails';
import { useDirection } from '../hooks/useDirection';
import useStore from '@/store/store';
import { attendanceStatusList } from '../services/AttendanceService';

const UserAttendanceHistory = () => {
const theme = useTheme<any>();
Expand Down Expand Up @@ -119,11 +118,14 @@ const UserAttendanceHistory = () => {
? "0"
: `${((data.presentCount / data.numberOfCohortMembers) * 100).toFixed(2)}`,
};


setAttendanceProgressBarData({
[shortDateFormat(selectedDate)]: attendanceInfo,
});
if (shortDateFormat(selectedDate) > shortDateFormat(new Date())) {
setAttendanceProgressBarData({});
} else {
setAttendanceProgressBarData({
[shortDateFormat(selectedDate)]: attendanceInfo,
});
}
};

const handleOpen = () => {
Expand Down Expand Up @@ -439,9 +441,9 @@ const UserAttendanceHistory = () => {
});
if (trimmedValue.length >= 3) {
debouncedSearch(trimmedValue);
}else if (trimmedValue === '') {
} else if (trimmedValue === '') {
debouncedSearch.cancel();
setDisplayStudentList(cohortMemberList);
setDisplayStudentList(cohortMemberList);
} else {
setDisplayStudentList(cohortMemberList);
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ const Dashboard: React.FC<DashboardProps> = () => {

const sessionArray: any[] = [];
const extraSessionArray: any[] = [];
if (response?.events.length > 0) {
if (response?.events?.length > 0) {
response?.events.forEach((event: any) => {
// console.log('myCohortList', myCohortList);
// let cohortList;
Expand Down Expand Up @@ -1548,7 +1548,7 @@ const Dashboard: React.FC<DashboardProps> = () => {
marginBottom: '12px',
}}
>
{t('COMMON.NO_SESSIONS_SCHEDULED')}
{t('COMMON.NO_SESSIONS_SCHEDULED')}asass
</Box>
)}
</Box>
Expand Down

0 comments on commit ae12833

Please sign in to comment.