Skip to content

Commit

Permalink
fix: Fix date difference parameters order
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasdotvin committed Apr 8, 2024
1 parent 02707b3 commit c31adf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/Concerns/HandlesRecurrence.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function calculateNextRecurrenceEnd(Carbon|string $start = null): Carbon
$start = Carbon::parse($start);
}

$recurrences = PeriodicityType::getDateDifference(from: now(), to: $start, unit: $this->periodicity_type);
$recurrences = PeriodicityType::getDateDifference(from: $start, to: now(), unit: $this->periodicity_type);
$expirationDate = $start->copy()->add($this->periodicity_type, $this->periodicity + $recurrences);

return $expirationDate;
Expand Down

0 comments on commit c31adf3

Please sign in to comment.