Add ID as sorting paramter
This commit is contained in:
parent
bf37cae1bf
commit
29b61d93fd
|
@ -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
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user