File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -105,18 +105,10 @@ export class TaskGroups {
105
105
106
106
private sortTaskGroups ( ) {
107
107
const compareFn = ( group1 : TaskGroup , group2 : TaskGroup ) => {
108
- // Compare two TaskGroup objects, sorting them by the group names at each grouping level.
109
- const groupNames1 = group1 . groups ;
110
- const groupNames2 = group2 . groups ;
111
- // The containers are guaranteed to be identical sizes,
112
- // they have one value for each 'group by' line in the query.
113
- for ( let i = 0 ; i < groupNames1 . length ; i ++ ) {
114
- // For now, we only have one sort option: sort by the names of the groups.
115
- // In future, we will add control over the sorting of group headings,
116
- // which will likely involve adjusting this code to sort by applying a Comparator
117
- // to the first Task in each group.
108
+ // Compare two TaskGroup objects, sorting them by first task in each group.
109
+ for ( let i = 0 ; i < this . _groupers . length ; i ++ ) {
118
110
const grouper = this . _groupers [ i ] ;
119
- const result = groupNames1 [ i ] . localeCompare ( groupNames2 [ i ] , undefined , { numeric : true } ) ;
111
+ const result = grouper . comparator ( group1 . tasks [ 0 ] , group2 . tasks [ 0 ] ) ;
120
112
if ( result !== 0 ) {
121
113
return grouper . reverse ? - result : result ;
122
114
}
You can’t perform that action at this time.
0 commit comments