Can someone help me create an array of 52 weeks(three elements) with each week ending on Sunday and the first week will start on the following Sunday form current date. Element 1 = First date of week, Element 2 Last Date of week, and Element 3 a string of Last Date of week such as "5/18".
Do you know how to: 1) Create an array of 52 string elements? 2) Get the current date? 3) Transform a date into the format mm/dd as a string? 4) Find the next sunday from today? 5) Find the beginning of the current week?
Well, I am not very sure to understand your explanation of the problem. I seem to understand that your weeks go from Monday to Sunday, and you want the date of such Monday and Sunday starting from today, up to 52 weeks.
You can get the date of this week's Monday like this:
You can get the date of this week's Sunday like this:
Then you can easily move to the next week:
I hope that helps! [ May 16, 2008: Message edited by: Edwin Dalorzo ]
Steve, Take a look at the Calendar API a bit more. In particular the cal.add() and cal.get() methods. Note that add() does both addition/subtraction and get() can get you the month/date/year.