diff --git a/AUTHORS b/AUTHORS index dd741750e..9af124852 100644 --- a/AUTHORS +++ b/AUTHORS @@ -238,3 +238,4 @@ suggestions: Tomas Babej Nick Person Arnoud K + Ozgur Akgun diff --git a/ChangeLog b/ChangeLog index a8a339dfd..bd1c5db6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -57,6 +57,7 @@ - TW-115 allow "0day" durations for UDAs. - TW-128 new helper command; _envs. - TW-139 Possibility to execute shadow file generation (thanks to Arnoud K). +- TW-145 default.due should accept a Duration (thanks to Ozgur Akgun). - TW-168 modification of due date relative to current due date (thanks to Dirk Sarpe). - TW-186 Increase for numerical UDAs (thanks to Steffen Uhlig). diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index a54c6f938..02e130789 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -1124,7 +1124,8 @@ command, if you don't specify one. The default is blank. default.due=... Provides a default due date for the .I task add -command, if you don't specify one. The default is blank. +command, if you don't specify one. You can use a date, or a duration value which +is assumed to be relative to 'now'. The default is blank. .TP .B diff --git a/src/Task.cpp b/src/Task.cpp index 6d1bdb34d..a385dbff7 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -1399,7 +1399,13 @@ void Task::validate (bool applyDefault /* = true */) ! has ("due")) { if (context.columns["due"]->validate (Task::defaultDue)) - set ("due", Date (Task::defaultDue).toEpoch ()); + { + Duration dur (Task::defaultDue); + if ((time_t) dur != 0) + set ("due", (Date () + dur).toEpoch ()); + else + set ("due", Date (Task::defaultDue).toEpoch ()); + } } // If a UDA has a default value in the configuration,