Move the date to end of the month if the date falls between the month.
What exactly do you mean by "consider end of the month date if date falls between the month"? Your two examples don't show anything that would be between something.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.