I'm working on a little payments system and must generate a list of payment days (monthly) given an initial date and number of payments. So, for example:
Given:
startday: 2015/06/22
qtty: 6
I should get the day from initial date (22) and generate a list of 6 sequential monthly dates:
- 2015/06/22 (if initial date should be included, and is > than today)
- 2015/07/22
- 2015/08/24
- 2015/09/22
- 2015/10/22
- 2015/11/23
As you can see, generated dates should not be weekends (sat/dom) and -if possible- nor holidays
Is there any function that could help me achieve this? TIA
I think this might do what you want, including holidays:
Will echo
And with a start date of 2015/10/31 the output will be:
As a good extra tips, depending on how you want to solve the 31st of Jan problem, if you want the last of each month, you can always use the following: