mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Task
- If a date attribute is eval'ed and the result is a duration, add the value of 'now' to it, and store the result. So '2wks' as a due date is interpreted as 'now + 2ks'.
This commit is contained in:
parent
a32f2f991a
commit
398bc9c824
1 changed files with 8 additions and 2 deletions
10
src/Task.cpp
10
src/Task.cpp
|
@ -2020,8 +2020,14 @@ void Task::modify (modType type)
|
||||||
e.evaluateInfixExpression (value, v);
|
e.evaluateInfixExpression (value, v);
|
||||||
context.debug (label + name + " <-- " + format ("{1}", v.get_date ()) + " <-- " + (std::string) v + " <-- " + value);
|
context.debug (label + name + " <-- " + format ("{1}", v.get_date ()) + " <-- " + (std::string) v + " <-- " + value);
|
||||||
|
|
||||||
// TODO If v is duration and < 5y, add to now, else store as date.
|
// If v is duration, add 'now' to it, else store as date.
|
||||||
// TODO Not sure if the above still holds true.
|
if (v.type () == Variant::type_duration)
|
||||||
|
{
|
||||||
|
Variant now;
|
||||||
|
if (namedDates ("now", now))
|
||||||
|
v += now;
|
||||||
|
}
|
||||||
|
|
||||||
set (name, v.get_date ());
|
set (name, v.get_date ());
|
||||||
++modCount;
|
++modCount;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue