From 8e83da9138da5b85897313f083f10ed78803638f Mon Sep 17 00:00:00 2001 From: Valtteri Kantanen Date: Mon, 14 Oct 2024 12:16:24 +0300 Subject: [PATCH] [Class statistics] Fix Credits gained for master's programmes --- .../PopulationDetails/CreditGainStats/CreditsGainedTable.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/frontend/src/components/PopulationDetails/CreditGainStats/CreditsGainedTable.jsx b/services/frontend/src/components/PopulationDetails/CreditGainStats/CreditsGainedTable.jsx index e8ab049196..1de9c83c5e 100644 --- a/services/frontend/src/components/PopulationDetails/CreditGainStats/CreditsGainedTable.jsx +++ b/services/frontend/src/components/PopulationDetails/CreditGainStats/CreditsGainedTable.jsx @@ -39,7 +39,9 @@ export const CreditsGainedTable = ({ filteredStudents, programmeGoalTime, type, } else { creditList = filteredStudents.map(({ studentNumber, courses }) => ({ studentNumber, - credits: getStudentTotalCredits({ courses }), + credits: getStudentTotalCredits({ + courses: courses.filter(course => moment(course.date).isBetween(startDate ?? start, endDate ?? end)), + }), })) }