how to find whether the sunday falls between two dates.if sunday exist subtract one days from the difference between two days
how to find whether the sunday falls between two dates.if sunday exist subtract one
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I understand correctly, you are looking for something like this:
The endDate needs to be the most recent date. The first part simply keeps us from checking if the start and end dates are more than 6 days apart (it will include a sunday, so no need to continue). The second bit just walks backward one day at a time from the endDate checking if Sunday is in there.
Once you know if sunday is part of the span, you can make whatever changes to the dates you want from the calling code.