I am looking for a way to determine the next occurrence of a certain day of a month. This would refer to a numbered day (e.g. the next 30th). Every month should always have one eligible date, so in case a particular month doesn't have the specified day, we wouldn't overflow to the next one, getting the last day of that month instead.
- Carbon provides the nthOfMonth function, but it refers to weekdays.
- I found a couple of answers, but they deal with getting that day next month instead of the next fitting occurrence of a day
- This answer only provides a start date, while in this case we might be many months or years in the future and we want to "catch up" with a subscription from that point on
- This answer seems closer, but it seems like it could be made more readable or less verbose with Carbon
Is there any built in function in Carbon that fits this use case? It seems odd to have the nthOfMonth function and other functions with "No Overflow" without getting this case covered in between.