mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-07 01:15:09 +00:00
Monotone-Parent: a336ee635278e6e84b9ccbf7290474e132c9c0a2
Monotone-Revision: 3e32e33bcda13cac968969da6e841bd9e5f639d1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-30T22:45:19 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
2006-08-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/NSCalendarDate+UIx.[hm]: category removed, code
|
||||
moved into NSCalendarDate+Scheduler instead.
|
||||
|
||||
* SoObjects/Appointments/SOGoAppointmentFolder.m
|
||||
([SOGoAppointmentFolder -setTimeZone:newTZ]): new method to
|
||||
configure the timezone from SOGoUserFolder when the instance is
|
||||
|
||||
@@ -24,9 +24,12 @@
|
||||
|
||||
#import <Foundation/NSCalendarDate.h>
|
||||
|
||||
@interface NSCalendarDate (UIxCalMonthOverviewExtensions)
|
||||
@interface NSCalendarDate (SchedulerExtensions)
|
||||
|
||||
- (BOOL) isDateInSameMonth: (NSCalendarDate *) _other;
|
||||
- (NSCalendarDate *) dayOfWeeK: (unsigned) _day
|
||||
offsetFromSunday: (unsigned) _off;
|
||||
- (NSCalendarDate *) sundayOfWeek;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -19,17 +19,39 @@
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <NGExtensions/NSCalendarDate+misc.h>
|
||||
|
||||
#import "NSCalendarDate+Scheduler.h"
|
||||
|
||||
@implementation NSCalendarDate (UIxCalMonthOverviewExtensions)
|
||||
@implementation NSCalendarDate (SchedulerExtensions)
|
||||
|
||||
- (BOOL) isDateInSameMonth: (NSCalendarDate *)_other
|
||||
- (BOOL) isDateInSameMonth: (NSCalendarDate *) _other
|
||||
{
|
||||
return (([_other yearOfCommonEra] == [self yearOfCommonEra]) &&
|
||||
([_other monthOfYear] == [self monthOfYear]));
|
||||
}
|
||||
|
||||
- (NSCalendarDate *) dayOfWeeK: (unsigned) _day
|
||||
offsetFromSunday: (unsigned) _offset
|
||||
{
|
||||
unsigned dayOfWeek, distance;
|
||||
|
||||
/* perform "locale" correction */
|
||||
dayOfWeek = (7 + [self dayOfWeek] - _offset) % 7;
|
||||
|
||||
_day = (_day % 7);
|
||||
if(_day == dayOfWeek)
|
||||
return self;
|
||||
|
||||
distance = _day - dayOfWeek;
|
||||
return [self dateByAddingYears:0 months:0 days:distance];
|
||||
}
|
||||
|
||||
/* this implies that monday is the start of week! */
|
||||
|
||||
- (NSCalendarDate *) sundayOfWeek
|
||||
{
|
||||
return [self dayOfWeeK:6 offsetFromSunday:1];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2004 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with OGo; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA.
|
||||
*/
|
||||
// $Id: UIxAppointmentEditor.m 181 2004-08-11 15:13:25Z helge $
|
||||
|
||||
#ifndef __NSCalendarDate_UIx_H__
|
||||
#define __NSCalendarDate_UIx_H__
|
||||
|
||||
#import <Foundation/NSCalendarDate.h>
|
||||
|
||||
@interface NSCalendarDate(UIx)
|
||||
|
||||
- (NSCalendarDate *)dayOfWeeK:(unsigned)_day offsetFromSunday:(unsigned)_off;
|
||||
- (NSCalendarDate *)sundayOfWeek;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* __NSCalendarDate_UIx_H__ */
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2004 SKYRIX Software AG
|
||||
|
||||
This file is part of OpenGroupware.org.
|
||||
|
||||
OGo is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU Lesser General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with OGo; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA.
|
||||
*/
|
||||
// $Id: UIxAppointmentEditor.m 181 2004-08-11 15:13:25Z helge $
|
||||
|
||||
#include "NSCalendarDate+UIx.h"
|
||||
#include "common.h"
|
||||
|
||||
@implementation NSCalendarDate(UIx)
|
||||
|
||||
- (NSCalendarDate *)dayOfWeeK:(unsigned)_day
|
||||
offsetFromSunday:(unsigned)_offset
|
||||
{
|
||||
unsigned dayOfWeek, distance;
|
||||
|
||||
/* perform "locale" correction */
|
||||
dayOfWeek = (7 + [self dayOfWeek] - _offset) % 7;
|
||||
|
||||
_day = (_day % 7);
|
||||
if(_day == dayOfWeek)
|
||||
return self;
|
||||
|
||||
distance = _day - dayOfWeek;
|
||||
return [self dateByAddingYears:0 months:0 days:distance];
|
||||
}
|
||||
|
||||
/* this implies that monday is the start of week! */
|
||||
|
||||
- (NSCalendarDate *)sundayOfWeek {
|
||||
return [self dayOfWeeK:6 offsetFromSunday:1];
|
||||
}
|
||||
|
||||
@end /* NSCalendarDate(UIx) */
|
||||
Reference in New Issue
Block a user