Bug #405 - after upgrade, "due:" filter not working for tasks created in version 1.9.0

- Fixed bug #405, which incorrectly compared dates on tasks created by
  versions earlier than 1.9.1 to those created by 1.9.1 or later (thanks to
  Ivo Jimenez).
This commit is contained in:
Paul Beckingham 2010-06-27 16:55:29 -04:00
parent 688233b3a4
commit b2eb9c3265
2 changed files with 21 additions and 2 deletions

View file

@ -45,6 +45,9 @@
if the year was not included in the dateformat (thanks to Michelle Crane). if the year was not included in the dateformat (thanks to Michelle Crane).
+ Fixed bug #132, which failed to set a sort order so that active tasks sort + Fixed bug #132, which failed to set a sort order so that active tasks sort
higher than inactive tasks, all things being equal. higher than inactive tasks, all things being equal.
+ Fixed bug #405, which incorrectly compared dates on tasks created by
versions earlier than 1.9.1 to those created by 1.9.1 or later (thanks to
Ivo Jimenez).
------ old releases ------------------------------ ------ old releases ------------------------------

View file

@ -492,8 +492,24 @@ bool Att::match (const Att& other) const
// If there are no mods, just perform a straight compare on value. // If there are no mods, just perform a straight compare on value.
if (mMod == "") if (mMod == "")
{ {
if (!compare (mValue, other.mValue, (bool) case_sensitive)) // Exact matches on dates should only compare m/d/y, not h:m:s. This allows
return false; // Comapisons like "task list due:today" (bug #405).
std::string which = type (mName);
if (which == "date")
{
Date left (mValue);
Date right (other.mValue);
if (left.year () != right.year () ||
left.month () != right.month () ||
left.day () != right.day ())
return false;
}
else
{
if (!compare (mValue, other.mValue, (bool) case_sensitive))
return false;
}
} }
// has = contains as a substring. // has = contains as a substring.