Assume today is 2005-11-07 (it is).
Create two ACTIONs, one due 2005-11-01, the other 2005-11-15.
Use an ACTIONSEARCH to query against these actions:
%ACTIONSEARCH{ state="open" within="14" }%
- Only the 2005-11-15 item should show up. Instead, both appear.
- Change 14 to -14. Only the 2005-11-01 item should show up. Instead both appear.
B0rked.
--
JST
More info. In your dox you say:
"Works in both directions, so you can use this to search for actions which are going to fall due within a certain number of days, or a negative number for actions that fell due between a time in the past and now."
What you do right now is:
"...search for actions which fall due prior to a certain number of days in the future, or a negative number for actions that fell due after a certain time in the past."
In other words, you never check that a date is on the "wrong" side of now, based on the sign of the within parameter.
From IRC, where I pasted a fix for the problem:
File lib/TWiki/Plugins/ActionTrackerPlugin/Action.pm
sub _matchField_within {
my ( $this, $val ) = @_;
my $secs = $this->secsToGo();
my $slack = $secs - $val * 60 * 60 * 24;
if ($val > 0) {
return ($slack <= 0) if ($secs > 0);
} else {
return ($slack >= 0) if ($secs < 0);
}
}
I'd check it in, but it's not my code.
--
JST
Spoke to
CC, and he approved the checkin. Note I have
NOT added testcases to confirm this feature does not regress, so I'm not closing the issue - but I am downgrading it to "Low".
Committed revision 7376.
--
JST
SVN 7540
CC