Closed GoogleCodeExporter closed 8 years ago
Hey Carlos, I tracked this one down. Here was the issue...
differenceInDays is used to calculate the week (row) the appointment will start
and end. This method returns an absolute value. So when 6/27 is the start date,
and the test date is 6/03, it returns 24 day difference, when in fact it should
be -24.
As a result, the calculateWeekFor returns a value of 3 (24/7), when in fact the
desired result would actually be 0.
So I added the following check at the start of calculateWeekFor, AND the
dayInWeek method:
if(testDate.before(calendarFirstDate)) {
return 0;
}
You can see the unit test for this here:
appointmentFromPriorMonthInFirstWeekOfNextMonth_issue66()
Original comment by Brad.Ryd...@gmail.com
on 19 Aug 2010 at 9:25
Original issue reported on code.google.com by
Brad.Ryd...@gmail.com
on 13 Jul 2010 at 1:50Attachments: