- TW-145 default.due should accept a Duration (thanks to Ozgur Akgun).
This commit is contained in:
Paul Beckingham 2014-12-27 14:44:31 -05:00
parent 8590af8cf2
commit bbc40c051d
4 changed files with 11 additions and 2 deletions

View file

@ -238,3 +238,4 @@ suggestions:
Tomas Babej
Nick Person
Arnoud K
Ozgur Akgun

View file

@ -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).

View file

@ -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

View file

@ -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,