TW-1640: '_get <id>.start' for an inactive tasks returns a date formatted from epoch 0.

This commit is contained in:
Paul Beckingham 2015-07-24 22:47:50 -04:00
parent ebbd20b719
commit 0f72d3d502
3 changed files with 22 additions and 3 deletions

View file

@ -233,7 +233,13 @@ bool DOM::get (const std::string& name, const Task& task, Variant& value)
}
if (column->type () == "date")
value = Variant (task.get_date (canonical), Variant::type_date);
{
auto numeric = task.get_date (canonical);
if (numeric == 0)
value = Variant ("");
else
value = Variant (numeric, Variant::type_date);
}
else if (column->type () == "duration" || canonical == "recur")
value = Variant ((time_t) Duration (task.get (canonical)), Variant::type_duration);
else if (column->type () == "numeric")
@ -306,10 +312,16 @@ bool DOM::get (const std::string& name, const Task& task, Variant& value)
}
if (column->type () == "date")
value = Variant (ref.get_date (canonical), Variant::type_date);
{
auto numeric = ref.get_date (canonical);
if (numeric == 0)
value = Variant ("");
else
value = Variant (numeric, Variant::type_date);
}
else if (column->type () == "duration")
{
std::string period = ref.get (canonical);
auto period = ref.get (canonical);
context.debug ("ref.get(" + canonical + ") --> " + period);
ISO8601p iso;