diff --git a/AUTHORS b/AUTHORS index 2d385ac5c..3e4dae85a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -182,3 +182,6 @@ suggestions: Friedrich Heusler Ben Armstrong XTaran + John West + Dmitriy Matrosov + Michele Santullo diff --git a/ChangeLog b/ChangeLog index c581984d1..aaa873591 100644 --- a/ChangeLog +++ b/ChangeLog @@ -67,7 +67,11 @@ Bugs Wilk). + #1263 The 'waiting' report properly lists only pending tasks with a wait date (thanks to Fidel Mato). + + #1268 Edit doesn't accept changes, if task has completed dependency (thanks + to Dmitriy Matrosov, Michele Santullo). + #1270 The 'undo' command is now properly removing backlog entries. + + #1273 Query with negative relative date differs greatly from absolute date + in past (thanks to John West). + #1279 Assorted corrections to the task-ref.pdf document (thanks to Benjamin Weber). + #1286 Cannot use "sow", "som", etc in "entry.after", "end.after" filters @@ -80,6 +84,7 @@ Bugs + #1387 ZSH Auto-Completion dates are not current (thanks to Benjamin Weber). + #1388 Updated task(1) man pages with import/export script examples (thanks to Benjamin Weber). + + #1410 Incomplete Date Synonym List in man task (thanks to Benjamin Weber). + Fixed bug so that 'limit:page' now considers footnote messages. + Fixed bug where specifying an ID of 0 yielded all completed/deleted tasks (thanks to greenskeleton). diff --git a/doc/man/task.1.in b/doc/man/task.1.in index 12d0f4036..c58989bb1 100644 --- a/doc/man/task.1.in +++ b/doc/man/task.1.in @@ -890,6 +890,22 @@ This sets the wait date to 1/18/2038. .TP Next occurring weekday task ... due:fri + +.TP +Predictable holidays +task ... due:goodfriday +.br +task ... due:easter +.br +task ... due:eastermonday +.br +task ... due:ascension +.br +task ... due:pentecost +.br +task ... due:midsommar +.br +task ... due:midsommarafton .RE .SS FREQUENCIES diff --git a/src/Duration.cpp b/src/Duration.cpp index 57246dd98..2919e861d 100644 --- a/src/Duration.cpp +++ b/src/Duration.cpp @@ -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; diff --git a/src/E9.cpp b/src/E9.cpp index 7464ebd4c..5cc4bcd88 100644 --- a/src/E9.cpp +++ b/src/E9.cpp @@ -185,7 +185,10 @@ void E9::eval (const Task& task, std::vector & 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 diff --git a/src/Task.cpp b/src/Task.cpp index 3ff4ccfe4..30a28c199 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -990,11 +990,6 @@ void Task::addDependency (const std::string& uuid) if (uuid == get ("uuid")) throw std::string (STRING_TASK_DEPEND_ITSELF); - // Check that uuid is resolvable. - int id = context.tdb2.pending.id (uuid); - if (id == 0) - throw format (STRING_TASK_DEPEND_MISS_CREA, id); - // Store the dependency. std::string depends = get ("depends"); if (depends != "") diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 03b24f718..d716f64fd 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -660,20 +660,10 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string std::vector ::iterator dep; for (dep = dependencies.begin (); dep != dependencies.end (); ++dep) { - std::vector ids; - - // Crude UUID check - if (dep->length () == 36) - { - int id = context.tdb2.pending.id (*dep); - ids.push_back (id); - } + if (dep->length () >= 7) + task.addDependency (*dep); else - A3::extract_id (*dep, ids); - - std::vector ::iterator id; - for (id = ids.begin (); id != ids.end(); id++) - task.addDependency (*id); + task.addDependency ((int) strtol (dep->c_str (), NULL, 10)); } // UDAs diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp index a713691b8..6bd27c00f 100644 --- a/src/commands/Command.cpp +++ b/src/commands/Command.cpp @@ -463,7 +463,7 @@ void Command::modify_task ( std::string& description) { // Utilize Task::modify - task.modify(arguments, description); + task.modify (arguments, description); } //////////////////////////////////////////////////////////////////////////////// diff --git a/test/duration.t.cpp b/test/duration.t.cpp index 374c8563e..7c9097b43 100644 --- a/test/duration.t.cpp +++ b/test/duration.t.cpp @@ -51,7 +51,7 @@ int convertDuration (const std::string& input) int main (int argc, char** argv) { - UnitTest t (644); + UnitTest t (646); // Ensure environment has no influence. unsetenv ("TASKDATA"); @@ -728,6 +728,11 @@ int main (int argc, char** argv) t.is (convertDuration ("10d"), 10, "valid duration 10d"); t.is (convertDuration ("-"), 0, "valid duration -"); + + d = Duration ("-4d"); + t.is ((time_t)d, 4*86400, "-4d == 4*86400"); + t.ok (d.negative (), "-4d == negative"); + try { Duration left, right;