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:
@@ -377,7 +377,6 @@ int CmdInfo::execute (std::string& output)
|
|||||||
|
|
||||||
// Show any UDAs
|
// Show any UDAs
|
||||||
auto all = task.all ();
|
auto all = task.all ();
|
||||||
std::string type;
|
|
||||||
for (auto& att: all)
|
for (auto& att: all)
|
||||||
{
|
{
|
||||||
if (Context::getContext ().columns.find (att) != Context::getContext ().columns.end ())
|
if (Context::getContext ().columns.find (att) != Context::getContext ().columns.end ())
|
||||||
@@ -391,9 +390,9 @@ int CmdInfo::execute (std::string& output)
|
|||||||
row = view.addRow ();
|
row = view.addRow ();
|
||||||
view.set (row, 0, col->label ());
|
view.set (row, 0, col->label ());
|
||||||
|
|
||||||
if (type == "date")
|
if (col->type () == "date")
|
||||||
value = Datetime (value).toString (dateformat);
|
value = Datetime (value).toString (dateformat);
|
||||||
else if (type == "duration")
|
else if (col->type () == "duration")
|
||||||
{
|
{
|
||||||
Duration iso;
|
Duration iso;
|
||||||
std::string::size_type cursor = 0;
|
std::string::size_type cursor = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user