Skip to content

Conversation

lucasdotvin
Copy link
Owner

@lucasdotvin lucasdotvin commented Mar 20, 2025

This pull request includes changes to improve the handling of date differences and recurrence calculations in the PeriodicityType and HandlesRecurrence classes. Additionally, new test cases have been added to ensure the correctness of these calculations.

Improvements to date difference calculation:

  • src/Enums/PeriodicityType.php: Modified the getDateDifference method to handle cases where the start date is after the end date, ensuring the difference is always positive and adjusting the result based on the order of the dates.

Enhancements to recurrence calculation:

Addition of new test cases:

  • tests/Models/Concerns/HandlesRecurrenceTest.php: Added multiple test cases to verify the correct calculation of the next recurrence end date under various scenarios, including renewals after one month, multiple renewals within a month, and renewals after expiration.

@lucasdotvin lucasdotvin added the bug Something isn't working label Mar 20, 2025
@lucasdotvin lucasdotvin self-assigned this Mar 20, 2025
@lucasdotvin lucasdotvin merged commit fdb1325 into main Mar 20, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant