- TW-241 new column format; recur.short.
- All duration columns now default to compact ISO duration format.
This commit is contained in:
Paul Beckingham 2014-09-06 15:38:25 -04:00
parent d33de636f1
commit 861cc83e6d
4 changed files with 19 additions and 16 deletions

View file

@ -43,6 +43,7 @@
Muller). Muller).
- TW-221 Migrate task-faq man page to the Wiki. - TW-221 Migrate task-faq man page to the Wiki.
- TW-230 Filter tasks on partial UUIDs (thanks to Paul Kishimoto). - TW-230 Filter tasks on partial UUIDs (thanks to Paul Kishimoto).
- TW-241 new column format; recur.short.
- TW-242 extra Space when annotating a path/filename, taskopen can not open the - TW-242 extra Space when annotating a path/filename, taskopen can not open the
file (thanks to Andreas Kalex). file (thanks to Andreas Kalex).
- TW-244 task add "Description (Information)" results in - TW-244 task add "Description (Information)" results in

View file

@ -82,7 +82,7 @@ void ColumnRecur::measure (Task& task, unsigned int& minimum, unsigned int& maxi
if (_style == "default" || if (_style == "default" ||
_style == "duration") _style == "duration")
{ {
minimum = maximum = Duration (task.get ("recur")).formatCompact ().length (); minimum = maximum = Duration (task.get ("recur")).formatISO ().length ();
} }
else if (_style == "indicator") else if (_style == "indicator")
{ {
@ -100,22 +100,24 @@ void ColumnRecur::render (
int width, int width,
Color& color) Color& color)
{ {
if (task.has (_name))
{
if (_style == "default" || if (_style == "default" ||
_style == "duration") _style == "duration")
{ {
lines.push_back ( lines.push_back (
color.colorize ( color.colorize (
rightJustify ( rightJustify (
Duration (task.get ("recur")).formatCompact (), Duration (task.get ("recur")).formatISO (),
width))); width)));
} }
else if (_style == "indicator") else if (_style == "indicator")
{ {
if (task.has (_name))
lines.push_back ( lines.push_back (
color.colorize ( color.colorize (
rightJustify (context.config.get ("recurrence.indicator"), width))); rightJustify (context.config.get ("recurrence.indicator"), width)));
} }
}
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View file

@ -103,7 +103,7 @@ void ColumnUDA::measure (Task& task, unsigned int& minimum, unsigned int& maximu
} }
else if (_type == "duration") else if (_type == "duration")
{ {
minimum = maximum = utf8_width (Duration (value).formatCompact ()); minimum = maximum = utf8_width (Duration (value).formatISO ());
} }
else if (_type == "string") else if (_type == "string")
{ {
@ -156,7 +156,7 @@ void ColumnUDA::render (
lines.push_back ( lines.push_back (
color.colorize ( color.colorize (
rightJustify ( rightJustify (
Duration (value).formatCompact (), Duration (value).formatISO (),
width))); width)));
} }
else if (_type == "string") else if (_type == "string")

View file

@ -55,7 +55,7 @@ if (open my $fh, '>', $rc)
qx{../src/task rc:$rc add with extra:1day 2>&1}; qx{../src/task rc:$rc add with extra:1day 2>&1};
qx{../src/task rc:$rc add without 2>&1}; qx{../src/task rc:$rc add without 2>&1};
my $output = qx{../src/task rc:$rc uda 2>&1}; my $output = qx{../src/task rc:$rc uda 2>&1};
like ($output, qr/1\s+1d\s+with/, "$ut: UDA duration stored"); like ($output, qr/1\s+P1D\s+with/, "$ut: UDA duration stored");
like ($output, qr/2\s+without/, "$ut: UDA duration blank"); like ($output, qr/2\s+without/, "$ut: UDA duration blank");
# Ensure 'extra' is stored in original form. # Ensure 'extra' is stored in original form.