By using date object how we can calculate over lapping weeks?
For eg:
July 31(Tuesday) is end for the week number 38, However week number 38 ends Sunday i.e Aug 4.
However months are different
Any idea on this
Thanks all
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.
In our Calendar component, we use this code to calculate the first date in a week; and I bet it could be modified to find the last Date of the Week. IT makes use of the DateUtils library
To find the last date of a week, I suspect you can just call the firstDateOfWeek and add 6 days:
Note: The second batch of code was written in a browser and is completely untested.
Update:
Given a specific date, you can find out the weekOfYear number using the weekOfYear method in the DateUtils library. Use the methods above to find the first and last date of the week in question
Conceptually like this: