Add ID as sorting paramter

This commit is contained in:
kolaente 2019-12-03 23:11:37 +01:00
parent bf37cae1bf
commit 29b61d93fd
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 1 deletions

View File

@ -261,7 +261,7 @@ func sortTasks(tasks []*Task, by []*sortParam) {
// This is a map of properties that can be sorted by
// and their appropriate comparator function.
// The comparator function sort in ascending mode.
// The comparator function sorts in ascending mode.
var comparators = map[string]TaskComparator{
"text": func(lhs, rhs *Task) bool {
return lhs.Text < rhs.Text
@ -311,6 +311,9 @@ func sortTasks(tasks []*Task, by []*sortParam) {
"updated": func(lhs, rhs *Task) bool {
return lhs.Updated < rhs.Updated
},
"id": func(lhs, rhs *Task) bool {
return lhs.ID < rhs.ID
},
defaultComparator: func(lhs, rhs *Task) bool {
return lhs.ID < rhs.ID
},