From: znek Date: Thu, 24 Jun 2004 11:03:44 +0000 (+0000) Subject: code cleanup and fix for weekOfYear setting X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63d3f6a2e5c7f75a775ee6d91c8f4468e138773b;p=scalable-opengroupware.org code cleanup and fix for weekOfYear setting git-svn-id: http://svn.opengroupware.org/SOGo/trunk@62 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.m b/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.m index 4d11a3cb..17526f66 100644 --- a/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.m +++ b/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.m @@ -51,7 +51,11 @@ NSCalendarDate *date; self->weekOfYear = _week; - date = [[self startDate] mondayOfWeek:self->weekOfYear]; + if(_week == 52 || _week == 53) + date = [[self startDate] mondayOfWeek]; + else + date = [self startDate]; + date = [date mondayOfWeek:_week]; [self setCurrentWeekStartDate:date]; } diff --git a/ZideStore/UI-X/Scheduler/UIxCalMonthView.m b/ZideStore/UI-X/Scheduler/UIxCalMonthView.m index 7544aaac..fa3a2164 100644 --- a/ZideStore/UI-X/Scheduler/UIxCalMonthView.m +++ b/ZideStore/UI-X/Scheduler/UIxCalMonthView.m @@ -10,37 +10,39 @@ } - (NSCalendarDate *)endDate { - NSCalendarDate *startDate; - - startDate = [self startDate]; - return [startDate dateByAddingYears:0 months:0 days:[startDate numberOfDaysInMonth] - hours:0 minutes:0 seconds:0]; + NSCalendarDate *startDate = [self startDate]; + return [startDate dateByAddingYears:0 + months:0 + days:[startDate numberOfDaysInMonth] + hours:0 + minutes:0 + seconds:0]; } -/* URLs (TODO: fix scroll ranges for months!) */ +/* URLs */ - (NSDictionary *)prevMonthQueryParameters { NSCalendarDate *date; - - date = [[[self startDate] firstDayOfMonth] dateByAddingYears:0 - months:-1 - days:0 - hours:0 - minutes:0 - seconds:0]; + + date = [[self startDate] dateByAddingYears:0 + months:-1 + days:0 + hours:0 + minutes:0 + seconds:0]; return [self queryParametersBySettingSelectedDate:date]; } - (NSDictionary *)nextMonthQueryParameters { NSCalendarDate *date; - date = [[[self startDate] firstDayOfMonth] dateByAddingYears:0 - months:1 - days:0 - hours:0 - minutes:0 - seconds:0]; + date = [[self startDate] dateByAddingYears:0 + months:1 + days:0 + hours:0 + minutes:0 + seconds:0]; return [self queryParametersBySettingSelectedDate:date]; }