Skip to content

Commit

Permalink
fix(sortGrades): last-grades are calculated according to the entry da…
Browse files Browse the repository at this point in the history
…te and not the date of the assessment
  • Loading branch information
Truiteseche committed Mar 2, 2024
1 parent 2bedeba commit 29a6cbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ export default function App() {
const gradesFromJson = grades[activeAccount].notes;
const subjectDatas = {};

const lastGrades = gradesFromJson.slice(-3);
const lastGrades = gradesFromJson.toSorted((elA, elB) => (new Date(elA.dateSaisie)).getTime() - (new Date(elB.dateSaisie)).getTime()).slice(-3);

for (let grade of (gradesFromJson ?? [])) {
// handle mock exam periods
Expand Down

0 comments on commit 29a6cbc

Please sign in to comment.