Before now, the PHP builtin date->add method is used to get the next instalment dates for an annual recurring contribution, in this PR we change this and use the custom logic in getSameDayNextMonth. This will enable the proper handling of leap dates.
Also in a previous work we prevented the next scheduled contribution date day from exceeding 28, in this PR we limit it such that this will not affect the next scheduled contribution date day of annual recurring contribution whose month is not February
Before
If the last contribution date is 02/29 - the next scheduled date is 03-01
After
If the last contribution date is 02/29 - the next scheduled date is 02-28
Before
The next scheduled contribution date of annual recurring contribution can't exceed 28 for all months
After
The next scheduled contribution date of annual recurring contribution can exceed 28 so far it is not in the month of February
Overview
Before now, the PHP builtin
date->add
method is used to get the next instalment dates for an annual recurring contribution, in this PR we change this and use the custom logic ingetSameDayNextMonth
. This will enable the proper handling of leap dates.Also in a previous work we prevented the next scheduled contribution date day from exceeding 28, in this PR we limit it such that this will not affect the next scheduled contribution date day of annual recurring contribution whose month is not February
Before
If the last contribution date is 02/29 - the next scheduled date is 03-01
After
If the last contribution date is 02/29 - the next scheduled date is 02-28
Before
The next scheduled contribution date of annual recurring contribution can't exceed 28 for all months
After
The next scheduled contribution date of annual recurring contribution can exceed 28 so far it is not in the month of February