Skip to content

Commit

Permalink
fixed next recurring date
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed May 9, 2023
1 parent 1295cbd commit 7e5920d
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions app/Traits/Recurring.php
Expand Up @@ -186,26 +186,19 @@ public function getRecurringVirtualLimit()
return $limit;
}

public function getCurrentRecurring()
public function getNextRecurring()
{
if (! $schedule = $this->getRecurringSchedule()) {
return false;
}

if (! $current = $schedule->current()) {
return false;
}

return $current->getStart();
}
$schedule = $schedule->startsAfter($this->getRecurringRuleTodayDate());

public function getNextRecurring()
{
if (! $schedule = $this->getRecurringSchedule()) {
if ($schedule->count() == 0) {
return false;
}

if (! $next = $schedule->next()) {
if (! $next = $schedule->current()) {
return false;
}

Expand Down

0 comments on commit 7e5920d

Please sign in to comment.