fix: sort order by dueDate, then by id
This commit is contained in:
parent
2de94bc902
commit
ae971b23bc
1 changed files with 6 additions and 1 deletions
|
@ -207,7 +207,12 @@ export default {
|
||||||
// soonest before the later ones.
|
// soonest before the later ones.
|
||||||
// We can't use the api sorting here because that sorts tasks with a due date after
|
// We can't use the api sorting here because that sorts tasks with a due date after
|
||||||
// ones without a due date.
|
// ones without a due date.
|
||||||
this.tasks = tasks.sort((a, b) => a.dueDate - b.dueDate)
|
this.tasks = tasks.sort((a, b) => {
|
||||||
|
const sortByDueDate = b.dueDate - a.dueDate
|
||||||
|
return sortByDueDate === 0
|
||||||
|
? b.id - a.id
|
||||||
|
: sortByDueDate
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: this modification should happen in the store
|
// FIXME: this modification should happen in the store
|
||||||
|
|
Loading…
Reference in a new issue