mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Bug #542
- Fixed bug #542, which sorted the countdown columns incorrectly (thanks to Michelle Crane). - Duration could not parse all varieties of it's own output, which is why the sorting was broken, in particular negative durations and real numbers in durations (such as (1.2y'). - Sorting in Table::sort_compare for Table::periodAscending and Table::periodDescending was broken. - Missing unit tests for countdown_compact. - Imported Nibbler::getNumber from the Attitash project. - Additional Duration unit tests. - Additional Nibbler unit tests. - Additional countdown.t unit tests.
This commit is contained in:
parent
c2a84c7cf6
commit
38ffa390ea
8 changed files with 311 additions and 102 deletions
|
@ -763,8 +763,8 @@ bool sort_compare (int left, int right)
|
|||
return true;
|
||||
else if ((std::string)*cell_left != "" && (std::string)*cell_right == "")
|
||||
return false;
|
||||
else if (Duration ((std::string)*cell_left) < Duration ((std::string)*cell_right))
|
||||
return true;
|
||||
else
|
||||
return Duration ((std::string)*cell_left) < Duration ((std::string)*cell_right) ? true : false;
|
||||
break;
|
||||
|
||||
case Table::descendingPeriod:
|
||||
|
@ -772,8 +772,8 @@ bool sort_compare (int left, int right)
|
|||
return false;
|
||||
else if ((std::string)*cell_left == "" && (std::string)*cell_right != "")
|
||||
return true;
|
||||
else if (Duration ((std::string)*cell_left) < Duration ((std::string)*cell_right))
|
||||
return false;
|
||||
else
|
||||
return Duration ((std::string)*cell_left) < Duration ((std::string)*cell_right) ? false : true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue