CmdStats: Restored sane formats for durations

This commit is contained in:
Paul Beckingham 2015-08-15 10:06:55 -04:00
parent 27fd8910ae
commit 598a2e02fa
2 changed files with 7 additions and 15 deletions

View file

@ -20,7 +20,7 @@
- TW-1389 tw will import same UUID n-times if part of same import (thanks to - TW-1389 tw will import same UUID n-times if part of same import (thanks to
Markus Beppler). Markus Beppler).
- TW-1419 On add '-tag' is considered a tag removal, which makes no sense. - TW-1419 On add '-tag' is considered a tag removal, which makes no sense.
- Tw-1426 Adding a date in 1963 (why not?) stores a negative epoch, which fails - TW-1426 Adding a date in 1963 (why not?) stores a negative epoch, which fails
to export (thanks to Black Ops Testing). to export (thanks to Black Ops Testing).
- TW-1430 Slashes in project names don't work (thanks to Richard Boß). - TW-1430 Slashes in project names don't work (thanks to Richard Boß).
- TW-1432 start/stop can be issued on completed tasks (thanks to Renato Alves). - TW-1432 start/stop can be issued on completed tasks (thanks to Renato Alves).
@ -67,7 +67,7 @@
- TW-1553 Setting defaultheight:0 makes burndown command hang (thanks to Tomas - TW-1553 Setting defaultheight:0 makes burndown command hang (thanks to Tomas
Babej). Babej).
- TW-1555 Project Names Converted to Dates (thanks to Ryan). - TW-1555 Project Names Converted to Dates (thanks to Ryan).
- TW1566 Context is applied on 'task export' (thanks to Tomas Babej). - TW-1566 Context is applied on 'task export' (thanks to Tomas Babej).
- TW-1569 update wait:<wait-date> manpage entry (thanks to David Patrick). - TW-1569 update wait:<wait-date> manpage entry (thanks to David Patrick).
- TW-1572 Better urgency inheritance (thanks to Jens Erat). - TW-1572 Better urgency inheritance (thanks to Jens Erat).
- TW-1575 `task log` mangles URLs when quoted (thanks to Luke Macken). - TW-1575 `task log` mangles URLs when quoted (thanks to Luke Macken).

View file

@ -247,35 +247,35 @@ int CmdStats::execute (std::string& output)
row = view.addRow (); row = view.addRow ();
view.set (row, 0, STRING_CMD_STATS_USED_FOR); view.set (row, 0, STRING_CMD_STATS_USED_FOR);
view.set (row, 1, ISO8601p (latest - earliest).format ()); view.set (row, 1, ISO8601p (latest - earliest).formatVague ());
} }
if (totalT) if (totalT)
{ {
row = view.addRow (); row = view.addRow ();
view.set (row, 0, STRING_CMD_STATS_ADD_EVERY); view.set (row, 0, STRING_CMD_STATS_ADD_EVERY);
view.set (row, 1, ISO8601p (((latest - earliest) / totalT)).format ()); view.set (row, 1, ISO8601p (((latest - earliest) / totalT)).formatVague ());
} }
if (completedT) if (completedT)
{ {
row = view.addRow (); row = view.addRow ();
view.set (row, 0, STRING_CMD_STATS_COMP_EVERY); view.set (row, 0, STRING_CMD_STATS_COMP_EVERY);
view.set (row, 1, ISO8601p ((latest - earliest) / completedT).format ()); view.set (row, 1, ISO8601p ((latest - earliest) / completedT).formatVague ());
} }
if (deletedT) if (deletedT)
{ {
row = view.addRow (); row = view.addRow ();
view.set (row, 0, STRING_CMD_STATS_DEL_EVERY); view.set (row, 0, STRING_CMD_STATS_DEL_EVERY);
view.set (row, 1, ISO8601p ((latest - earliest) / deletedT).format ()); view.set (row, 1, ISO8601p ((latest - earliest) / deletedT).formatVague ());
} }
if (pendingT || completedT) if (pendingT || completedT)
{ {
row = view.addRow (); row = view.addRow ();
view.set (row, 0, STRING_CMD_STATS_AVG_PEND); view.set (row, 0, STRING_CMD_STATS_AVG_PEND);
view.set (row, 1, ISO8601p ((int) ((daysPending / (pendingT + completedT)) * 86400)).format ()); view.set (row, 1, ISO8601p ((int) ((daysPending / (pendingT + completedT)) * 86400)).formatVague ());
} }
if (totalT) if (totalT)
@ -285,14 +285,6 @@ int CmdStats::execute (std::string& output)
view.set (row, 1, format (STRING_CMD_STATS_CHARS, (int) (descLength / totalT))); view.set (row, 1, format (STRING_CMD_STATS_CHARS, (int) (descLength / totalT)));
} }
/*
// TODO Re-enable this when 2.3 has taskd support. Until then, it makes no
// sense to include this.
row = view.addRow ();
view.set (row, 0, STRING_CMD_STATS_LAST_SYNC);
view.set (row, 1, "-");
*/
// If an alternating row color is specified, notify the table. // If an alternating row color is specified, notify the table.
if (context.color ()) if (context.color ())
{ {