Fix unintuitive sorting edge cases

pull/1021/head
Robert Boyd III 4 years ago
parent c3896a4ab1
commit 35dd189c05
No known key found for this signature in database
GPG Key ID: 55B95B9349D916DF

@ -114,7 +114,8 @@ public class SortHelper {
+ ADJUSTED_DUE_DATE + ADJUSTED_DUE_DATE
+ ") END) " + ") END) "
+ // else due time + // else due time
"+ 172800000 * importance"); // add 2 days * importance // add slightly less than 2 days * importance to give due date priority over importance in case of tie
"+ 172799999 * importance");
} }
if (sortType != SORT_ALPHA) { if (sortType != SORT_ALPHA) {
order.addSecondaryExpression(ORDER_TITLE); order.addSecondaryExpression(ORDER_TITLE);
@ -174,7 +175,8 @@ public class SortHelper {
+ ADJUSTED_DUE_DATE.replace("dueDate", "tasks.dueDate") + ADJUSTED_DUE_DATE.replace("dueDate", "tasks.dueDate")
+ ") END) " + ") END) "
+ // else due time + // else due time
"+ 172800000 * tasks.importance AS sort_smart"; // add 2 days * importance // add slightly less than 2 days * importance to give due date priority over importance in case of tie
"+ 172799999 * tasks.importance AS sort_smart";
} }
return select; return select;

Loading…
Cancel
Save