mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 06:01:21 +00:00
This commit is contained in:
@@ -100,6 +100,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
private Collection $modifiers; // obsolete
|
||||
private Collection $operators;
|
||||
private string $originalQuery;
|
||||
private Carbon $date;
|
||||
|
||||
/**
|
||||
* OperatorQuerySearch constructor.
|
||||
@@ -115,6 +116,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
$this->words = [];
|
||||
$this->limit = 25;
|
||||
$this->originalQuery = '';
|
||||
$this->date = today(config('app.timezone'));
|
||||
$this->validOperators = array_keys(config('firefly.search.operators'));
|
||||
$this->startTime = microtime(true);
|
||||
$this->accountRepository = app(AccountRepositoryInterface::class);
|
||||
@@ -144,6 +146,14 @@ class OperatorQuerySearch implements SearchInterface
|
||||
return $this->operators;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Carbon $date
|
||||
*/
|
||||
public function setDate(Carbon $date): void
|
||||
{
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @codeCoverageIgnore
|
||||
@@ -255,7 +265,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
throw new FireflyException(sprintf('Firefly III search cant handle "%s"-nodes', $class));
|
||||
case Subquery::class:
|
||||
// loop all notes in subquery:
|
||||
foreach($searchNode->getNodes() as $subNode) {
|
||||
foreach ($searchNode->getNodes() as $subNode) {
|
||||
$this->handleSearchNode($subNode); // lets hope its not too recursive!
|
||||
}
|
||||
break;
|
||||
@@ -831,7 +841,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
{
|
||||
$parser = new ParseDateString;
|
||||
if ($parser->isDateRange($value)) {
|
||||
return $parser->parseRange($value, today(config('app.timezone')));
|
||||
return $parser->parseRange($value, $this->date);
|
||||
}
|
||||
$date = $parser->parseDate($value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user