1
/* Interface for NSCalendarDate for GNUStep
2
Copyright (C) 1994, 1996, 1999 Free Software Foundation, Inc.
4
This file is part of the GNUstep Base Library.
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Library General Public
8
License as published by the Free Software Foundation; either
9
version 2 of the License, or (at your option) any later version.
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Library General Public License for more details.
16
You should have received a copy of the GNU Library General Public
17
License along with this library; if not, write to the Free
18
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
21
#ifndef __NSCalendarDate_h_GNUSTEP_BASE_INCLUDE
22
#define __NSCalendarDate_h_GNUSTEP_BASE_INCLUDE
24
#include <Foundation/NSDate.h>
27
@class NSTimeZoneDetail;
29
@interface NSCalendarDate : NSDate
31
NSTimeInterval _seconds_since_ref;
32
NSString *_calendar_format;
33
NSTimeZone *_time_zone;
36
// Getting an NSCalendar Date
38
+ (id) dateWithString: (NSString*)description
39
calendarFormat: (NSString*)format;
40
+ (id) dateWithString: (NSString*)description
41
calendarFormat: (NSString*)format
42
locale: (NSDictionary*)dictionary;
43
+ (id) dateWithYear: (int)year
44
month: (unsigned int)month
45
day: (unsigned int)day
46
hour: (unsigned int)hour
47
minute: (unsigned int)minute
48
second: (unsigned int)second
49
timeZone: (NSTimeZone*)aTimeZone;
51
// Initializing an NSCalendar Date
52
- (id) initWithString: (NSString*)description;
53
- (id) initWithString: (NSString*)description
54
calendarFormat: (NSString*)format;
55
- (id) initWithString: (NSString*)description
56
calendarFormat: (NSString*)fmt
57
locale: (NSDictionary*)locale;
58
- (id) initWithYear: (int)year
59
month: (unsigned int)month
60
day: (unsigned int)day
61
hour: (unsigned int)hour
62
minute: (unsigned int)minute
63
second: (unsigned int)second
64
timeZone: (NSTimeZone*)aTimeZone;
66
// Retreiving Date Elements
67
- (int) dayOfCommonEra;
74
- (int) secondOfMinute;
75
- (int) yearOfCommonEra;
77
// Providing Adjusted Dates
78
- (NSCalendarDate*) addYear: (int)year
85
// Getting String Descriptions of Dates
86
- (NSString*) description;
87
- (NSString*) descriptionWithCalendarFormat: (NSString*)format;
88
- (NSString*) descriptionWithCalendarFormat: (NSString*)format
89
locale: (NSDictionary*)locale;
90
- (NSString*) descriptionWithLocale: (NSDictionary*)locale;
92
// Getting and Setting Calendar Formats
93
- (NSString*) calendarFormat;
94
- (void) setCalendarFormat: (NSString*)format;
96
// Getting and Setting Time Zones
97
- (void) setTimeZone: (NSTimeZone*)aTimeZone;
98
#ifndef STRICT_OPENSTEP
99
- (NSTimeZone*) timeZone;
101
#ifndef STRICT_MACOS_X
102
- (NSTimeZoneDetail*) timeZoneDetail;
110
* Adds <code>-weekOfYear</code> method.
112
@interface NSCalendarDate (GSCategories)
114
* The ISO standard week of the year is based on the first week of the
115
* year being that week (starting on monday) for which the thursday
116
* is on or after the first of january.<br />
117
* This has the effect that, if january first is a friday, saturday or
118
* sunday, the days of that week (up to and including the sunday) are
119
* considered to be in week 53 of the preceeding year. Similarly if the
120
* last day of the year is a monday tuesday or wednesday, these days are
121
* part of week 1 of the next year.
126
@interface NSCalendarDate (GregorianDate)
128
- (int) lastDayOfGregorianMonth: (int)month year: (int)year;
129
- (int) absoluteGregorianDay: (int)day month: (int)month year: (int)year;
130
- (void) gregorianDateFromAbsolute: (int)d
138
GSBreakTime(NSTimeInterval when, int *year, int *month, int *day, int *hour,
139
int *minute, int *second, int *mil);
141
GSTime(int day, int month, int year, int hour, int minute, int second, int mil);
145
#ifndef STRICT_MACOS_X
146
@interface NSCalendarDate (OPENSTEP)
148
- (NSCalendarDate*) dateByAddingYears: (int)years
152
minutes: (int)minutes
153
seconds: (int)seconds;
155
- (void) years: (int*)years
159
minutes: (int*)minutes
160
seconds: (int*)seconds
161
sinceDate: (NSDate*)date;
165
#endif /* __NSCalendarDate_h_GNUSTEP_BASE_INCLUDE*/