mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-23 23:46:42 +02:00
Bug #1273
- #1273 Query with negative relative date differs greatly from absolute date in past (thanks to John West).
This commit is contained in:
parent
9099a353ea
commit
c1492d8010
6 changed files with 16 additions and 3 deletions
|
@ -368,6 +368,8 @@ bool Duration::valid (const std::string& input)
|
|||
Nibbler n (lower_input);
|
||||
n.getNumber (value);
|
||||
|
||||
// Negative values are valid, but do not need to complicate the validation
|
||||
// check.
|
||||
if (value < 0.0)
|
||||
value = -value;
|
||||
|
||||
|
|
|
@ -185,7 +185,10 @@ void E9::eval (const Task& task, std::vector <Arg>& value_stack)
|
|||
{
|
||||
Duration dur (operand._raw);
|
||||
Date now;
|
||||
now += (int)(time_t) dur;
|
||||
if (dur.negative ())
|
||||
now -= (int)(time_t) dur;
|
||||
else
|
||||
now += (int)(time_t) dur;
|
||||
operand._value = now.toEpochString ();
|
||||
}
|
||||
else
|
||||
|
|
|
@ -463,7 +463,7 @@ void Command::modify_task (
|
|||
std::string& description)
|
||||
{
|
||||
// Utilize Task::modify
|
||||
task.modify(arguments, description);
|
||||
task.modify (arguments, description);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue