Removed the DatePicker from the stats
This commit is contained in:
@@ -60,16 +60,16 @@ export default function Stats() {
|
|||||||
if (user) setStatsUserId(user.id);
|
if (user) setStatsUserId(user.id);
|
||||||
}, [user]);
|
}, [user]);
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
if (stats && stats.length > 0) {
|
// if (stats && stats.length > 0) {
|
||||||
const sortedStats = stats.sort((a, b) => a.date - b.date);
|
// const sortedStats = stats.sort((a, b) => a.date - b.date);
|
||||||
const firstStat = sortedStats.shift()!;
|
// const firstStat = sortedStats.shift()!;
|
||||||
|
|
||||||
setStartDate(moment.unix(firstStat.date).toDate());
|
// setStartDate(moment.unix(firstStat.date).toDate());
|
||||||
console.log(stats.filter((x) => moment.unix(x.date).isAfter(startDate)));
|
// console.log(stats.filter((x) => moment.unix(x.date).isAfter(startDate)));
|
||||||
console.log(stats.filter((x) => moment.unix(x.date).isBefore(endDate)));
|
// console.log(stats.filter((x) => moment.unix(x.date).isBefore(endDate)));
|
||||||
}
|
// }
|
||||||
}, [stats]);
|
// }, [stats]);
|
||||||
|
|
||||||
const calculateTotalScorePerSession = () => {
|
const calculateTotalScorePerSession = () => {
|
||||||
const groupedBySession = groupBySession(stats);
|
const groupedBySession = groupBySession(stats);
|
||||||
@@ -210,7 +210,7 @@ export default function Stats() {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
<DatePicker
|
{/* <DatePicker
|
||||||
dateFormat="dd/MM/yyyy"
|
dateFormat="dd/MM/yyyy"
|
||||||
startDate={startDate}
|
startDate={startDate}
|
||||||
endDate={endDate}
|
endDate={endDate}
|
||||||
@@ -220,7 +220,7 @@ export default function Stats() {
|
|||||||
setStartDate(initialDate);
|
setStartDate(initialDate);
|
||||||
setEndDate(finalDate);
|
setEndDate(finalDate);
|
||||||
}}
|
}}
|
||||||
/>
|
/> */}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex gap-4 flex-wrap">
|
<div className="flex gap-4 flex-wrap">
|
||||||
{/* Exams per module */}
|
{/* Exams per module */}
|
||||||
|
|||||||
Reference in New Issue
Block a user