mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
CmdInfo: Properly format date and duration UDAs
The 'type' variable was never assigned value, hence the checking for 'date' and/or 'duration' always failed. Use col->type() instead. Closes #2060.
This commit is contained in:
parent
3b978ce265
commit
6ff63286b5
1 changed files with 2 additions and 3 deletions
|
@ -377,7 +377,6 @@ int CmdInfo::execute (std::string& output)
|
|||
|
||||
// Show any UDAs
|
||||
auto all = task.all ();
|
||||
std::string type;
|
||||
for (auto& att: all)
|
||||
{
|
||||
if (Context::getContext ().columns.find (att) != Context::getContext ().columns.end ())
|
||||
|
@ -391,9 +390,9 @@ int CmdInfo::execute (std::string& output)
|
|||
row = view.addRow ();
|
||||
view.set (row, 0, col->label ());
|
||||
|
||||
if (type == "date")
|
||||
if (col->type () == "date")
|
||||
value = Datetime (value).toString (dateformat);
|
||||
else if (type == "duration")
|
||||
else if (col->type () == "duration")
|
||||
{
|
||||
Duration iso;
|
||||
std::string::size_type cursor = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue