[F] Fix filter assignment order issue
This commit is contained in:
@@ -191,15 +191,20 @@ export default class App extends Vue
|
|||||||
// Filter assignments into terms
|
// Filter assignments into terms
|
||||||
let termAssignments: Assignment[][] = [[], [], [], []];
|
let termAssignments: Assignment[][] = [[], [], [], []];
|
||||||
let currentTerm = 0;
|
let currentTerm = 0;
|
||||||
course.assignments.forEach(a =>
|
|
||||||
|
// Loop through it by time order
|
||||||
|
for (let i = course.assignments.length - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
|
let a = course.assignments[i];
|
||||||
|
|
||||||
// On to the next term
|
// On to the next term
|
||||||
if (currentTerm < 3 && a.date > Constants.TERMS[currentTerm + 1])
|
if (currentTerm < 3 && a.date > Constants.TERMS[currentTerm + 1])
|
||||||
|
{
|
||||||
currentTerm ++;
|
currentTerm ++;
|
||||||
|
|
||||||
// Push data
|
// Push data
|
||||||
termAssignments[currentTerm].push(a);
|
termAssignments[currentTerm].push(a);
|
||||||
});
|
}
|
||||||
|
|
||||||
// Set computed data
|
// Set computed data
|
||||||
course.computed = {termAssignments: termAssignments, allYearGrade: -1};
|
course.computed = {termAssignments: termAssignments, allYearGrade: -1};
|
||||||
|
|||||||
Reference in New Issue
Block a user