diff --git a/ChangeLog b/ChangeLog index e448ab7c2..f66454849 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-11-02 Wolfgang Sourdeau + * UI/Scheduler/UIxCalMonthView.m ([UIxCalMonthView + rangesOf7Days]): enhanced and debugged algorithm to feed the array + with slices where the first day is still in the requested month. + * UI/Templates/UIxPageFrame.wox: the logConsole is created only on non-popup pages. diff --git a/UI/Scheduler/UIxCalMonthView.m b/UI/Scheduler/UIxCalMonthView.m index 43d6b150a..a1f1f9f18 100644 --- a/UI/Scheduler/UIxCalMonthView.m +++ b/UI/Scheduler/UIxCalMonthView.m @@ -292,6 +292,7 @@ NSCalendarDate *currentDate, *firstDayOfMonth, *lastDayOfMonth; NSMutableArray *rangesOf7Days; NSArray *currentRange; + int monthOfYear; rangesOf7Days = [NSMutableArray new]; [rangesOf7Days autorelease]; @@ -299,7 +300,13 @@ firstDayOfMonth = [[self selectedDate] firstDayOfMonth]; lastDayOfMonth = [firstDayOfMonth lastDayOfMonth]; currentDate = [firstDayOfMonth mondayOfWeek]; - while ([currentDate earlierDate: lastDayOfMonth] == currentDate) + currentRange = [self _rangeOf7DaysForWeekStartingOn: currentDate]; + [rangesOf7Days addObject: currentRange]; + + currentDate = [[currentRange objectAtIndex: 6] dateByAddingYears: 0 + months: 0 days: 1]; + monthOfYear = [currentDate monthOfYear]; + while ([currentDate monthOfYear] == monthOfYear) { currentRange = [self _rangeOf7DaysForWeekStartingOn: currentDate]; [rangesOf7Days addObject: currentRange];