mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
This commit is contained in:
@@ -80,7 +80,7 @@ class ShowController extends Controller
|
||||
->setPage($this->parameters->get('page'))
|
||||
// set types of transactions to return.
|
||||
->setTypes($types);
|
||||
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||
if (null !== $this->parameters->get('start') || null !== $this->parameters->get('end')) {
|
||||
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
}
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
|
@@ -819,22 +819,28 @@ trait TimeCollection
|
||||
/**
|
||||
* Set the start and end time of the results to return.
|
||||
*
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* Can either or both be NULL
|
||||
*
|
||||
* @param Carbon|null $start
|
||||
* @param Carbon|null $end
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setRange(Carbon $start, Carbon $end): GroupCollectorInterface
|
||||
public function setRange(?Carbon $start, ?Carbon $end): GroupCollectorInterface
|
||||
{
|
||||
if ($end < $start) {
|
||||
if (null !== $start && null !== $end && $end < $start) {
|
||||
[$start, $end] = [$end, $start];
|
||||
}
|
||||
// always got to end of day / start of day for ranges.
|
||||
$startStr = $start->format('Y-m-d 00:00:00');
|
||||
$endStr = $end->format('Y-m-d 23:59:59');
|
||||
$startStr = $start?->format('Y-m-d 00:00:00');
|
||||
$endStr = $end?->format('Y-m-d 23:59:59');
|
||||
|
||||
if (null !== $start) {
|
||||
$this->query->where('transaction_journals.date', '>=', $startStr);
|
||||
}
|
||||
if (null !== $end) {
|
||||
$this->query->where('transaction_journals.date', '<=', $endStr);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@@ -112,7 +112,7 @@ return [
|
||||
// see cer.php for exchange rates feature flag.
|
||||
],
|
||||
'version' => '6.0.24',
|
||||
'api_version' => '2.0.8',
|
||||
'api_version' => '2.0.9',
|
||||
'db_version' => 20,
|
||||
|
||||
// generic settings
|
||||
|
Reference in New Issue
Block a user