I have a new requirement. Could you please help in this
I would like to send out an email to the customer automatically every month on the below dates The day to send out the email will depend on whether it’s a 4- or 5-week month 4 week month 17th day 1st email 24th day 2nd email ---------- 5 week month 24th day 1st email 31st day 2nd email
That is my requirement, Could you help me with the logic I am also trying from my side
I will schedule the class for 17th, 24th and 31st.
Based in the schedule, If the current date is 17th, then one email need to sent. If the current date is 31st, then one email need to sent.
but here my confusion is How could make sure with 24th date.. ????
------------------------------- If it is 4th week of 24th I should send one email(If month contains 4 weeks) If it is 5th week of 24th I should send another email(If month contains 5 weeks)
So here I am getting little confuse to get clarity for both 24th dates.
I guess if there's 31 days in the month, then the 24th is the second email. I really don't have a good answer. All months technically cover at least 5 weeks.
Except for about once every 30 years, February would have 4 weeks when it aligns perfectly on Sunday and is not a leap year.