Java date processing
- by Don
Hi,
Given an instance of java.util.Date which is a Sunday. If there are 4 Sundays in the month in question, I need to figure out whether the chosen date is
1st Sunday of month
2nd Sunday of month
2nd last Sunday of month
Last Sunday of month
If there are 5 Sundays in the month in question, then I need to figure out whether the chosen date is
1st Sunday of month
2nd Sunday of month
3rd Sunday of month
2nd last Sunday of month
Last Sunday of month
I've had a look in JodaTime, but haven't found the relevant functionality there yet. The project is actually a Groovy project, so I could use either Java or Groovy to solve this.
Thanks,
Donal