mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Sorting
- Added missing custom sorting for due dates.
This commit is contained in:
parent
5fa77a36de
commit
c1b4f34a70
2 changed files with 27 additions and 4 deletions
27
src/sort.cpp
27
src/sort.cpp
|
@ -137,9 +137,32 @@ static bool sort_compare (int left, int right)
|
|||
(left_string == "H" && (right_string == "M" || right_string == "L"));
|
||||
}
|
||||
|
||||
// Due Date.
|
||||
else if (field == "due")
|
||||
{
|
||||
left_string = (*global_data)[left].get (field);
|
||||
right_string = (*global_data)[right].get (field);
|
||||
|
||||
if (left_string != "" && right_string == "")
|
||||
return true;
|
||||
|
||||
if (left_string == "" && right_string != "")
|
||||
return false;
|
||||
|
||||
if (left_string == right_string)
|
||||
continue;
|
||||
|
||||
left_date = atoi (left_string.c_str ());
|
||||
right_date = atoi (right_string.c_str ());
|
||||
|
||||
if (ascending)
|
||||
return left_date < right_date;
|
||||
|
||||
return left_date > right_date;
|
||||
}
|
||||
|
||||
// Date.
|
||||
else if (field == "due" ||
|
||||
field == "end" ||
|
||||
else if (field == "end" ||
|
||||
field == "entry" ||
|
||||
field == "start" ||
|
||||
field == "until" ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue