-
Notifications
You must be signed in to change notification settings - Fork 0
/
KalLogic.h
executable file
·48 lines (42 loc) · 1.84 KB
/
KalLogic.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Copyright (c) 2009 Keith Lazuka
* License: http://www.opensource.org/licenses/mit-license.html
*/
#import <Foundation/Foundation.h>
/*
* KalLogic
* ------------------
*
* Private interface
*
* As a client of the Kal system you should not need to use this class directly
* (it is managed by the internal Kal subsystem).
*
* The KalLogic represents the current state of the displayed calendar month
* and provides the logic for switching between months and determining which days
* are in a month as well as which days are in partial weeks adjacent to the selected
* month.
*
*/
@interface KalLogic : NSObject
{
NSDate *baseDate;
NSDate *fromDate;
NSDate *toDate;
NSArray *daysInSelectedMonth;
NSArray *daysInFinalWeekOfPreviousMonth;
NSArray *daysInFirstWeekOfFollowingMonth;
NSDateFormatter *monthAndYearFormatter;
}
@property (nonatomic, strong) NSDate *baseDate; // The first day of the currently selected month
@property (nonatomic, strong, readonly) NSDate *fromDate; // The date corresponding to the tile in the upper-left corner of the currently selected month
@property (nonatomic, strong, readonly) NSDate *toDate; // The date corresponding to the tile in the bottom-right corner of the currently selected month
@property (nonatomic, strong, readonly) NSArray *daysInSelectedMonth; // array of NSDate
@property (nonatomic, strong, readonly) NSArray *daysInFinalWeekOfPreviousMonth; // array of NSDate
@property (nonatomic, strong, readonly) NSArray *daysInFirstWeekOfFollowingMonth; // array of NSDate
@property (copy, nonatomic, readonly) NSString *selectedMonthNameAndYear; // localized (e.g. "September 2010" for USA locale)
- (id)initForDate:(NSDate *)date; // designated initializer.
- (void)retreatToPreviousMonth;
- (void)advanceToFollowingMonth;
- (void)moveToMonthForDate:(NSDate *)date;
@end