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