From 538c6d902b12c0f9a543e592ec49bff6c2226427 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 2 Nov 2006 23:17:24 +0000 Subject: [PATCH] Monotone-Parent: 62549471f18965b7b2503aa161e5f3bcffbf413f Monotone-Revision: 10deb1bcf6f918959ada6d978cd79273abe58a30 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-11-02T23:17:24 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Scheduler/UIxCalMonthView.m | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) 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];