And you are trying to create a fixed membership with payment plan in non leap year (such as 2023), but with future dates that fall within a leap year (such as 2024-01-01 to 2024-12-31), then the membership form will keep not allow you to set the end date to "2024-12-31", and instead will keep changing the end date into "2023-12-31" which is the fixed period rollover day during the current year (instead of the using the future year that you are trying to create the membership in), This will also result in showing wrong pro-rata membership fees:
The membership end date is no longer being set based on current year, and instead it is now more aligned with the selected membership dates, and because of that the membership fees are now calculated correctly:
I also found out that other scenarios around leap years that were not handled correctly before but they now do, such as:
Having a fixed membership type that is configured to start on or after March, and a membership of such type is created with start date that is also on or after March. In this case the leap day (which is February the 29th) shouldn't be included, so to calculate the price of one day of the membership, the membership fee should be divided by 365 instead of 366
Having a fixed membership type that is configured to end on or after March, and a membership of such type is created with end date that is also on or after March. In this case the price of one day of the membership should be the membership fee divided bye 366 (given the leap day 29th of February is within the membership period).
In addition to that, I found that the "skip pro-rata" setting was not always utilized correctly, given it was always relying on the "Current Year" to check if the membership pro-rata should be skipped or not, instead of relying on the input start membership and end dates, so cases where the membership starts during one year (such as 2024) and ends in another (e.g 2025), or the membership is created in the future (e.g we are in 2024 and trying to create a membership that starts and ends in 2025).
Before
If you have a fixed membership with:
And you are trying to create a fixed membership with payment plan in non leap year (such as 2023), but with future dates that fall within a leap year (such as 2024-01-01 to 2024-12-31), then the membership form will keep not allow you to set the end date to "2024-12-31", and instead will keep changing the end date into "2023-12-31" which is the fixed period rollover day during the current year (instead of the using the future year that you are trying to create the membership in), This will also result in showing wrong pro-rata membership fees:
https://github.com/compucorp/uk.co.compucorp.membershipextras/assets/6275540/4b77faef-ffca-461e-a4c6-a8a72bd6539f
After
The membership end date is no longer being set based on current year, and instead it is now more aligned with the selected membership dates, and because of that the membership fees are now calculated correctly:
https://github.com/compucorp/uk.co.compucorp.membershipextras/assets/6275540/1798f7d8-9d43-48d4-a179-d4c4be03ac02
I also found out that other scenarios around leap years that were not handled correctly before but they now do, such as:
In addition to that, I found that the "skip pro-rata" setting was not always utilized correctly, given it was always relying on the "Current Year" to check if the membership pro-rata should be skipped or not, instead of relying on the input start membership and end dates, so cases where the membership starts during one year (such as 2024) and ends in another (e.g 2025), or the membership is created in the future (e.g we are in 2024 and trying to create a membership that starts and ends in 2025).