diff --git a/ChangeLog b/ChangeLog index 74ec81581..a9eb3b9b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,8 @@ example "task oldest 5" will display the 5 oldest tasks. + Modified the "stats" report so that it has the same aesthetics as the other reports. + + New "timesheet" command displays tasks completed and started, per week, + and can display multiple weeks. ------ old releases ------------------------------ diff --git a/html/advanced.html b/html/advanced.html index 976dcd2d6..fd5c3180e 100644 --- a/html/advanced.html +++ b/html/advanced.html @@ -231,9 +231,16 @@
- ??? + The timesheet report shows a list of tasks completed and started + during a one-week period. In the example above, 2 weeks of tasks + are shown. +
++ By default, the report starts on a Monday. To override this + value, add an entry to your .taskrc file like this: +
weekstart=Sunday
% task calendar
diff --git a/html/task.html b/html/task.html
index d9db48fad..320b05941 100644
--- a/html/task.html
+++ b/html/task.html
@@ -164,36 +164,14 @@ (Find out what was new in prior versions)
- +
Task has been built from source and tested in the following environments:
diff --git a/src/report.cpp b/src/report.cpp
index 18a12295c..ceed687c0 100644
--- a/src/report.cpp
+++ b/src/report.cpp
@@ -1346,42 +1346,156 @@ std::string handleReportTimesheet (TDB& tdb, T& task, Config& conf)
for (int week = 0; week < quantity; ++week)
{
- out << start.toString (conf.get ("dateformat", "m/d/Y"))
+ out << std::endl
+ << Text::colorize (Text::bold, Text::nocolor)
+ << start.toString (conf.get ("dateformat", "m/d/Y"))
<< " - "
<< end.toString (conf.get ("dateformat", "m/d/Y"))
+ << Text::colorize ()
<< std::endl;
// Render the completed table.
Table completed;
+ completed.setTableWidth (width);
+ completed.addColumn (" ");
+ completed.addColumn ("Project");
+ completed.addColumn ("Due");
+ completed.addColumn ("Description");
+
+ completed.setColumnUnderline (1);
+ completed.setColumnUnderline (2);
+ completed.setColumnUnderline (3);
+
+ completed.setColumnWidth (0, Table::minimum);
+ completed.setColumnWidth (1, Table::minimum);
+ completed.setColumnWidth (2, Table::minimum);
+ completed.setColumnWidth (3, Table::flexible);
+
+ completed.setColumnJustification (0, Table::left);
+ completed.setColumnJustification (1, Table::left);
+ completed.setColumnJustification (2, Table::right);
+ completed.setColumnJustification (3, Table::left);
+
foreach (t, tasks)
{
- // TODO If task completed within range.
+ // If task completed within range.
+ if (t->getStatus () == T::completed)
+ {
+ Date compDate (::atoi (t->getAttribute ("end").c_str ()));
+ if (compDate >= start && compDate < end)
+ {
+ int row = completed.addRow ();
+ completed.addCell (row, 1, t->getAttribute ("project"));
+
+ std::string due = t->getAttribute ("due");
+ if (due.length ())
+ {
+ Date d (::atoi (due.c_str ()));
+ due = d.toString (conf.get ("dateformat", "m/d/Y"));
+ completed.addCell (row, 2, due);
+ }
+
+ std::string description = t->getDescription ();
+ std::string when;
+ std::map