mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
New Column - recur
- Added new column 'recur' for use in custom reports. - Implemented Table::ascendingPeriod, Table::descendingPeriod allowing sorting on the recur column. - Added unit tests to both use the new column and test the sorting. - Code cleanup.
This commit is contained in:
parent
751094cffb
commit
17de9fec9f
9 changed files with 125 additions and 12 deletions
|
@ -941,6 +941,24 @@ void Table::sort (std::vector <int>& order)
|
|||
((std::string)*left == "M" && (std::string)*right == "H"))
|
||||
SWAP
|
||||
break;
|
||||
|
||||
case ascendingPeriod:
|
||||
if ((std::string)*left == "" && (std::string)*right != "")
|
||||
break;
|
||||
else if ((std::string)*left != "" && (std::string)*right == "")
|
||||
SWAP
|
||||
else if (convertDuration ((std::string)*left) > convertDuration ((std::string)*right))
|
||||
SWAP
|
||||
break;
|
||||
|
||||
case descendingPeriod:
|
||||
if ((std::string)*left != "" && (std::string)*right == "")
|
||||
break;
|
||||
else if ((std::string)*left == "" && (std::string)*right != "")
|
||||
SWAP
|
||||
else if (convertDuration ((std::string)*left) < convertDuration ((std::string)*right))
|
||||
SWAP
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue