mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-24 23:52:43 +00:00
Monotone-Parent: dc9546aa264cf85f1f6b8f2ec57bc434090e2acf
Monotone-Revision: 47c738d4060de254c8a00eaab4912c7bfdb67933 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-22T19:24:48 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -20,7 +20,74 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSCalendarDate.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import "UIxCalMainView.h"
|
||||
|
||||
static NSMutableArray *monthMenuItems = nil;
|
||||
static NSMutableArray *yearMenuItems = nil;
|
||||
|
||||
@implementation UIxCalMainView
|
||||
|
||||
- (NSArray *) monthMenuItems
|
||||
{
|
||||
unsigned int count;
|
||||
|
||||
if (!monthMenuItems)
|
||||
{
|
||||
monthMenuItems = [NSMutableArray arrayWithCapacity: 12];
|
||||
|
||||
for (count = 1; count < 13; count++)
|
||||
[monthMenuItems addObject:
|
||||
[NSString stringWithFormat: @"%.2d", count]];
|
||||
[monthMenuItems retain];
|
||||
}
|
||||
|
||||
return monthMenuItems;
|
||||
}
|
||||
|
||||
- (void) setMonthMenuItem: (NSString *) aMonthMenuItem
|
||||
{
|
||||
monthMenuItem = aMonthMenuItem;
|
||||
}
|
||||
|
||||
- (NSString *) monthMenuItem
|
||||
{
|
||||
return monthMenuItem;
|
||||
}
|
||||
|
||||
- (NSString *) monthMenuItemLabel
|
||||
{
|
||||
return [self localizedNameForMonthOfYear: [monthMenuItem intValue]];
|
||||
}
|
||||
|
||||
- (NSArray *) yearMenuItems
|
||||
{
|
||||
int count, year;
|
||||
|
||||
if (!yearMenuItems)
|
||||
{
|
||||
year = [[NSCalendarDate date] yearOfCommonEra];
|
||||
yearMenuItems = [NSMutableArray arrayWithCapacity: 11];
|
||||
for (count = -5; count < 6; count++)
|
||||
[yearMenuItems addObject: [NSNumber numberWithInt: year + count]];
|
||||
[yearMenuItems retain];
|
||||
}
|
||||
|
||||
return yearMenuItems;
|
||||
}
|
||||
|
||||
- (void) setYearMenuItem: (NSNumber *) aYearMenuItem
|
||||
{
|
||||
yearMenuItem = aYearMenuItem;
|
||||
}
|
||||
|
||||
- (NSNumber *) yearMenuItem
|
||||
{
|
||||
return yearMenuItem;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user