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
|
@ -79,6 +79,8 @@
|
||||||
- TW-1636 UUID with numeric-only first segment is not parsed properly (thanks
|
- TW-1636 UUID with numeric-only first segment is not parsed properly (thanks
|
||||||
to Tomas Babej).
|
to Tomas Babej).
|
||||||
- TW-1638 Undo doesn't work when a context is set (thanks to Jeremy John Reeder).
|
- TW-1638 Undo doesn't work when a context is set (thanks to Jeremy John Reeder).
|
||||||
|
- TW-1640 '_get <id>.start' for an inactive tasks returns a date formatted from
|
||||||
|
epoch 0.
|
||||||
- Prevent potential task duplication during import for non-pending tasks.
|
- Prevent potential task duplication during import for non-pending tasks.
|
||||||
- Show the active context in "context list", if any is active.
|
- Show the active context in "context list", if any is active.
|
||||||
- Fix "task edit" dropping annotation text after newlines.
|
- Fix "task edit" dropping annotation text after newlines.
|
||||||
|
|
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")
|
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")
|
else if (column->type () == "duration" || canonical == "recur")
|
||||||
value = Variant ((time_t) Duration (task.get (canonical)), Variant::type_duration);
|
value = Variant ((time_t) Duration (task.get (canonical)), Variant::type_duration);
|
||||||
else if (column->type () == "numeric")
|
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")
|
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")
|
else if (column->type () == "duration")
|
||||||
{
|
{
|
||||||
std::string period = ref.get (canonical);
|
auto period = ref.get (canonical);
|
||||||
context.debug ("ref.get(" + canonical + ") --> " + period);
|
context.debug ("ref.get(" + canonical + ") --> " + period);
|
||||||
|
|
||||||
ISO8601p iso;
|
ISO8601p iso;
|
||||||
|
|
|
@ -190,6 +190,11 @@ class TestDOM(TestCase):
|
||||||
code, out, err = self.t.runError("_get rc.missing")
|
code, out, err = self.t.runError("_get rc.missing")
|
||||||
self.assertEqual(code, 1)
|
self.assertEqual(code, 1)
|
||||||
|
|
||||||
|
def test_dom_attribute_missing(self):
|
||||||
|
"""DOM 1.end (missing)"""
|
||||||
|
code, out, err = self.t("_get 1.end")
|
||||||
|
self.assertEqual("\n", out)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from simpletap import TAPTestRunner
|
from simpletap import TAPTestRunner
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue