mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-20 11:19:16 +00:00
This commit is contained in:
@@ -84,6 +84,8 @@ class ShowController extends Controller
|
|||||||
$transformer->setParameters(new ParameterBag());
|
$transformer->setParameters(new ParameterBag());
|
||||||
|
|
||||||
$array = $transformer->transform($recurrence);
|
$array = $transformer->transform($recurrence);
|
||||||
|
|
||||||
|
|
||||||
$groups = $this->recurring->getTransactions($recurrence);
|
$groups = $this->recurring->getTransactions($recurrence);
|
||||||
$today = today(config('app.timezone'));
|
$today = today(config('app.timezone'));
|
||||||
$array['repeat_until'] = null !== $array['repeat_until'] ? new Carbon($array['repeat_until']) : null;
|
$array['repeat_until'] = null !== $array['repeat_until'] ? new Carbon($array['repeat_until']) : null;
|
||||||
|
@@ -408,10 +408,15 @@ class RecurringRepository implements RecurringRepositoryInterface
|
|||||||
|
|
||||||
private function filterMaxDate(?Carbon $max, array $occurrences): array
|
private function filterMaxDate(?Carbon $max, array $occurrences): array
|
||||||
{
|
{
|
||||||
if (null === $max) {
|
|
||||||
return $occurrences;
|
|
||||||
}
|
|
||||||
$filtered = [];
|
$filtered = [];
|
||||||
|
if (null === $max) {
|
||||||
|
foreach ($occurrences as $date) {
|
||||||
|
if ($date->gt(today())) {
|
||||||
|
$filtered[] = $date;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $filtered;
|
||||||
|
}
|
||||||
foreach ($occurrences as $date) {
|
foreach ($occurrences as $date) {
|
||||||
if ($date->lte($max) && $date->gt(today())) {
|
if ($date->lte($max) && $date->gt(today())) {
|
||||||
$filtered[] = $date;
|
$filtered[] = $date;
|
||||||
|
@@ -128,7 +128,8 @@ class RecurrenceTransformer extends AbstractTransformer
|
|||||||
];
|
];
|
||||||
|
|
||||||
// get the (future) occurrences for this specific type of repetition:
|
// get the (future) occurrences for this specific type of repetition:
|
||||||
$occurrences = $this->repository->getXOccurrencesSince($repetition, $fromDate, new Carbon(), 5);
|
$amount = 'daily' === $repetition->repetition_type ? 9 : 5;
|
||||||
|
$occurrences = $this->repository->getXOccurrencesSince($repetition, $fromDate, now(), $amount);
|
||||||
|
|
||||||
/** @var Carbon $carbon */
|
/** @var Carbon $carbon */
|
||||||
foreach ($occurrences as $carbon) {
|
foreach ($occurrences as $carbon) {
|
||||||
|
Reference in New Issue
Block a user