From c31adf3744075cd9960d67a74be4bb874a338df9 Mon Sep 17 00:00:00 2001 From: Lucas Vinicius Date: Mon, 8 Apr 2024 00:49:14 -0300 Subject: [PATCH] fix: Fix date difference parameters order --- src/Models/Concerns/HandlesRecurrence.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Concerns/HandlesRecurrence.php b/src/Models/Concerns/HandlesRecurrence.php index 3d449e0..690e82c 100644 --- a/src/Models/Concerns/HandlesRecurrence.php +++ b/src/Models/Concerns/HandlesRecurrence.php @@ -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;