mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TW-1640: '_get <id>.start' for an inactive tasks returns a date formatted from epoch 0.
This commit is contained in:
parent
ebbd20b719
commit
0f72d3d502
3 changed files with 22 additions and 3 deletions
18
src/DOM.cpp
18
src/DOM.cpp
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue