To fix this, I propose a modification to the Interval selector, which allows it to continue to accept the current syntax for a WeekInterval.StartWeek/EndWeek (i.e. "01-May-2005 to 07-May-2005") but which will now also accept a single date corresponding to any of the days within that week (i.e. for the above week, any of "01-May-2005", "02-May-2005" ... "07-May-2005" would represent the above week when passed as the value of StartWeek/EndWeek).
With this enhancement, then generating the seven week interval becomes trivial: pass the current day as the EndWeek, and subtract 49 days from it to get the StartWeek.
This is not hard to code from a Java perspective, and makes it vastly simpler to write little programs such as our current Ant script to generate analyses at the Week grain size.
WeekInterval has this capability already. You can just set WeekInterval.StartWeek as "03-Mar-2005" and WeekInterval.EndWeek as "03-May-2005"
to get interval from week of "03-Mar-2005" to week of "03-May-2005".
It works. I just added two test cases to make sure it is okay.
Hongbing
Anyone see any problems with this? If not, would Hongbing mind taking a break from Jess hacking to whack this out?
Cheers, Philip
