sort by due date, items with due dates come first
This commit is contained in:
@@ -270,6 +270,14 @@ class OrgTodoListView extends ItemView {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// sort by due date - items with due dates first!
|
||||||
|
this.filtered.sort((a, b) => {
|
||||||
|
if (a.dueDate && b.dueDate) return a.dueDate.localeCompare(b.dueDate);
|
||||||
|
if (a.dueDate) return -1; // a has a date, b doesn't → a first
|
||||||
|
if (b.dueDate) return 1; // b has a date, a doesn't → b first
|
||||||
|
return 0; // neither has a date → keep as-is
|
||||||
|
});
|
||||||
|
|
||||||
this.listEl.empty();
|
this.listEl.empty();
|
||||||
|
|
||||||
if (this.filtered.length === 0) {
|
if (this.filtered.length === 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user