diff --git a/ChangeLog b/ChangeLog index a86f932bb..6810352bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,7 +33,8 @@ + Added feature #608, and now completing a task, with journal.time turned on will stop the task first (thanks to Andy Kriger). + Added feature #629, a new holiday configuration file for New Zealand - (thanks to Stephen Haywood) + (thanks to Stephen Haywood). + + Added feature #638, a wait:later possibility (thanks to Clément Bœsch). + Added new holiday configuration file for Italy (thanks to Nicola Busanello). + Added new holiday configuration file for Austria (thanks to Andreas Poisel). + Eliminated dependency on ncurses. diff --git a/NEWS b/NEWS index 4405ebebd..81367f4df 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,8 @@ New Features in taskwarrior 1.9.4 any other report, but returns unformatted JSON. - Import can now read from files and URLs. - Assorted bug fixes. + - new worded date "later" and "someday" to be used with the wait attribute to + hide a task until somepoint in time (this sets the wait date to 1/18/2038). Please refer to the ChangeLog file for full details. There are too many to list here. diff --git a/doc/man/task.1.in b/doc/man/task.1.in index e81a1078d..4217d5826 100644 --- a/doc/man/task.1.in +++ b/doc/man/task.1.in @@ -590,6 +590,15 @@ task ... due:eom .br task ... due:eoy +.TP +At some point or later +.br +task ... wait:later +.br +task ... wait:someday + +This sets the wait date to 1/18/2038. + .TP Next occurring weekday task ... due:fri diff --git a/src/Date.cpp b/src/Date.cpp index 94fa15154..f82a80da3 100644 --- a/src/Date.cpp +++ b/src/Date.cpp @@ -985,6 +985,8 @@ bool Date::isRelativeDate (const std::string& input) supported.push_back ("midsommar"); supported.push_back ("midsommarafton"); supported.push_back ("now"); + supported.push_back ("later"); + supported.push_back ("someday"); std::vector matches; if (autoComplete (in, supported, matches) == 1) @@ -1141,6 +1143,12 @@ bool Date::isRelativeDate (const std::string& input) mT = time (NULL); return true; } + else if (found == "later" || found == "someday") + { + Date then (1, 18, 2038); + mT = then.mT; + return true; + } } // Support "21st" to indicate the next date that is the 21st day. diff --git a/test/date.t.cpp b/test/date.t.cpp index 3e4a49731..b04326e41 100644 --- a/test/date.t.cpp +++ b/test/date.t.cpp @@ -34,7 +34,7 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest t (162); + UnitTest t (165); try { @@ -336,6 +336,11 @@ int main (int argc, char** argv) Date r16 ("soy"); t.notok (r16.sameYear (now), "soy not in same year as now"); + Date later ("later"); + t.is (later.month (), 1, "later -> m = 1"); + t.is (later.day (), 18, "later -> d = 18"); + t.is (later.year (), 2038, "later -> y = 2038"); + // Date::sameHour Date r17 ("6/7/2010 01:00:00", "m/d/Y H:N:S"); Date r18 ("6/7/2010 01:59:59", "m/d/Y H:N:S");