Report date format
- added new reportdateformat to extend the formatting of due dates in the reports and "task info" - added new conversion sequences a, A, b, B and Y to be used with reportdateformat
This commit is contained in:
@@ -52,6 +52,9 @@
|
||||
#include "Timer.h"
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
#include "Context.h"
|
||||
|
||||
extern Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Table::Table ()
|
||||
@@ -868,6 +871,46 @@ void Table::sort (std::vector <int>& order)
|
||||
}
|
||||
break;
|
||||
|
||||
case ascendingDueDate:
|
||||
{
|
||||
if ((std::string)*left != "" && (std::string)*right == "")
|
||||
break;
|
||||
|
||||
else if ((std::string)*left == "" && (std::string)*right != "")
|
||||
SWAP
|
||||
|
||||
else
|
||||
{
|
||||
Date dl ((std::string)*left, context.config.get("reportdateformat",
|
||||
context.config.get("dateformat","m/d/Y")));
|
||||
Date dr ((std::string)*right, context.config.get("reportdateformat",
|
||||
context.config.get("dateformat","m/d/Y")));
|
||||
if (dl > dr)
|
||||
SWAP
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case descendingDueDate:
|
||||
{
|
||||
if ((std::string)*left != "" && (std::string)*right == "")
|
||||
break;
|
||||
|
||||
else if ((std::string)*left == "" && (std::string)*right != "")
|
||||
SWAP
|
||||
|
||||
else
|
||||
{
|
||||
Date dl ((std::string)*left, context.config.get("reportdateformat",
|
||||
context.config.get("dateformat","m/d/Y")));
|
||||
Date dr ((std::string)*right, context.config.get("reportdateformat",
|
||||
context.config.get("dateformat","m/d/Y")));
|
||||
if (dl < dr)
|
||||
SWAP
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ascendingPriority:
|
||||
if (((std::string)*left == "" && (std::string)*right != "") ||
|
||||
((std::string)*left == "M" && (std::string)*right == "L") ||
|
||||
|
||||
Reference in New Issue
Block a user