diff --git a/ChangeLog b/ChangeLog index a5340aae1..adfa36c9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -61,6 +61,8 @@ and overdue. + Fixed bug #459, which showed a confusing message when 'limit:page' was used, with few tasks. + + Fixed bug #461, in which the filter 'due:today' failed, but 'due.is:today' + worked. + Fixed bug #466, which gave the wrong error message when a custom report was missing a direction indicator for the sort order. + Fixed bug #470, which caused task to not support the color 'none'. diff --git a/src/Att.cpp b/src/Att.cpp index 21233202c..9b74bb960 100644 --- a/src/Att.cpp +++ b/src/Att.cpp @@ -415,7 +415,7 @@ bool Att::validNameValue ( "\" is not a valid status. Use 'pending', 'completed', 'deleted', 'recurring' or 'waiting'."; } - else if (! validInternalName (name) && + else if (! validInternalName (name) && ! validModifiableName (name)) throw std::string ("'") + name + "' is not a recognized attribute."; @@ -438,11 +438,11 @@ bool Att::validMod (const std::string& mod) std::string Att::type (const std::string& name) const { if (name == "due" || + name == "wait" || name == "until" || name == "start" || name == "entry" || - name == "end" || - name == "wait") + name == "end") return "date"; else if (name == "recur") @@ -542,16 +542,17 @@ bool Att::match (const Att& other) const if (mMod == "") { // Exact matches on dates should only compare m/d/y, not h:m:s. This allows - // Comapisons like "task list due:today" (bug #405). + // comparisons like "task list due:today" (bug #405). std::string which = type (mName); if (which == "date") { + if (other.mValue == "") + return false; + Date left (mValue); Date right (other.mValue); - if (left.year () != right.year () || - left.month () != right.month () || - left.day () != right.day ()) + if (! left.sameDay (right)) return false; } else diff --git a/src/tests/due.t b/src/tests/due.t index 8448fcf0e..5792fc8cd 100755 --- a/src/tests/due.t +++ b/src/tests/due.t @@ -28,7 +28,7 @@ use strict; use warnings; -use Test::More tests => 7; +use Test::More tests => 9; # Create the rc file. if (open my $fh, '>', 'due.rc') @@ -57,6 +57,13 @@ my $output = qx{../task rc:due.rc list}; like ($output, qr/\[31m.+$just.+\[0m/, 'one marked due'); like ($output, qr/\s+$almost\s+/, 'two not marked due'); +qx{../task rc:due.rc add three due:today}; +$output = qx{../task rc:due.rc list due:today}; +like ($output, qr/three/, 'due:today works as a filter'); + +$output = qx{../task rc:due.rc list due.is:today}; +like ($output, qr/three/, 'due.is:today works as a filter'); + # Cleanup. unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data'); diff --git a/src/tests/wait.t b/src/tests/wait.t index f30a151f0..74adaf304 100755 --- a/src/tests/wait.t +++ b/src/tests/wait.t @@ -71,8 +71,8 @@ qx{../task rc:wait.rc add wait:tomorrow tomorrow}; $output = qx{../task rc:wait.rc ls}; unlike ($output, qr/tomorrow/ms, 'waiting task invisible'); -$output = qx{../task rc:wait.rc ls wait:tomorrow}; -like ($output, qr/tomorrow/ms, 'waiting task visible when specifically asked for it'); +$output = qx{../task rc:wait.rc all status:waiting wait:tomorrow}; +like ($output, qr/tomorrow/ms, 'waiting task visible when specifically queried'); # Cleanup. unlink 'pending.data';