From 6ff63286b54040a021ba78835f390eaa63de543e Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Mon, 28 Dec 2020 20:36:04 -0500 Subject: [PATCH] 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. --- src/commands/CmdInfo.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/commands/CmdInfo.cpp b/src/commands/CmdInfo.cpp index 342e284fa..f35ac9986 100644 --- a/src/commands/CmdInfo.cpp +++ b/src/commands/CmdInfo.cpp @@ -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;