2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __NGExtensions_NSCalendarDate_misc_H__
23 #define __NGExtensions_NSCalendarDate_misc_H__
25 #import <Foundation/NSDate.h>
27 #if NeXT_Foundation_LIBRARY || GNUSTEP_BASE_LIBRARY
28 # import <Foundation/NSCalendarDate.h>
31 @interface NSCalendarDate(misc)
35 - (short)numberOfWeeksInYear;
36 + (NSArray *)mondaysOfYear:(int)_year timeZone:(NSTimeZone *)_tz;
37 - (NSArray *)mondaysOfYear;
38 - (NSCalendarDate *)firstMondayAndLastWeekInYear:(short *)_lastWeek;
39 + (NSCalendarDate *)mondayOfWeek:(int)_weekNumber inYear:(int)_year
40 timeZone:(NSTimeZone *)_tz;
41 - (NSCalendarDate *)mondayOfWeek:(int)_weekNumber;
43 + (NSCalendarDate *)dateForJulianNumber:(long)_jn;
46 - (NSCalendarDate *)firstDayOfMonth;
47 - (NSCalendarDate *)lastDayOfMonth;
48 - (NSCalendarDate *)mondayOfWeek;
49 - (NSCalendarDate *)beginOfDay;
50 - (NSCalendarDate *)endOfDay;
51 - (int)numberOfDaysInMonth;
53 - (BOOL)isDateOnSameDay:(NSCalendarDate *)_date;
54 - (BOOL)isDateInSameWeek:(NSCalendarDate *)_date;
58 - (NSCalendarDate *)yesterday;
59 - (NSCalendarDate *)tomorrow;
63 - (NSCalendarDate *)nextYear;
64 - (NSCalendarDate *)lastYear;
66 /* returns a date on the same day with the specified time */
67 - (NSCalendarDate *)hour:(int)_hour minute:(int)_minute second:(int)_second;
68 - (NSCalendarDate *)hour:(int)_hour minute:(int)_minute;
71 applies the following modifications:
72 if year >= 70 && year < 135
74 elif year >= 0 && year < 70
78 - (NSCalendarDate *)y2kDate;
81 adding years, months and days while *keeping* the clock time, eg:
83 d1 = [NSCalendarDate dateWithYear:2000 month:2 day:15
84 hour:12 minute:0 second:0
86 d2 = [d1 dateByAddingYear:0 month:3 day:0];
88 [d2 hourOfDay] will be '15' though the timezone changed from
91 -dateByAddingYears:months:days:hours:minutes:seconds: which can
92 be found in NSCalendarDate will not keep the clock time (the time
93 will be adjusted in the new DST timezone
96 - (NSCalendarDate *)dateByAddingYears:(int)_years
100 /* calculate easter ... */
102 - (NSCalendarDate *)easterOfYear;
106 #endif /* __NGExtensions_NSCalendarDate_misc_H__ */