Index: lib/TWiki/Search.pm =================================================================== --- lib/TWiki/Search.pm (revision 3776) +++ lib/TWiki/Search.pm (working copy) @@ -386,6 +386,7 @@ my $theTopic = $params{topic} || ""; my $theType = $params{type} || ""; my $theWebName = $params{web} || ""; + my $theDate = $params{date} || ""; ##$this->writeDebug "Search locale is $TWiki::cfg{SiteLocale}"; @@ -661,6 +662,18 @@ ##$this->writeDebug "Topic list after sort = @topicList"; } + if( $theDate ){ + use TWiki::Time; + my @ends = &TWiki::Time::parseInterval($theDate); + my @resultList=(); + foreach my $topic (@topicList){ + # if date falls out of interval: exclude topic from result + my $topicdate = $this->store()->getTopicLatestRevTime( $web, $topic ); + push(@resultList, $topic) unless (($topicdate<$ends[0]) || ($topicdate>$ends[1])); + } + @topicList = @resultList; + } + # header and footer of $web my( $beforeText, $repeatText, $afterText ) = split( /%REPEAT%/, $tmplTable ); if( $theHeader ) { Index: lib/TWiki/Time.pm =================================================================== --- lib/TWiki/Time.pm (revision 3776) +++ lib/TWiki/Time.pm (working copy) @@ -224,4 +224,129 @@ return sprintf("%.0f", ($nextThursday - $firstFourth) / ( 7 * 86400 )) + 1; } + +=pod + +---++ StaticMethod parseInterval( $szInterval ) -> [$iSecs, $iSecs] + +Convert string representing a time interval to a pair of integers +representing the amount of seconds since epoch for the start and end +extremes of the time interval. + + * =$szInterval= - time interval string + +in yacc syntax, grammar and actions: +interval ::= date { $$.start = fillStart($1); $$.end = fillEnd($1); } + | date '/' date { $$.start = fillStart($1); $$.end = fillEnd($3); } + | 'P' duration '/' date { $$.start = fillEnd($4)-$2; $$.end = fillEnd($4); } + | date '/' 'P' duration { $$.start = fillStart($1); $$.end = fillStart($1)+$4; } + ; + +A TimeInterval is of the form (BNF): + *