2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo 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 OGo 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 OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #include <NGObjWeb/WOComponent.h>
27 @interface WeekOverview : WOComponent
35 @implementation WeekOverview
37 static inline void setDateWithKey(id obj, NSString *key) {
40 str = [obj objectForKey:key];
45 date = [NSCalendarDate dateWithString:str
46 calendarFormat:@"%Y-%m-%d %H:%M:%S %Z"];
47 [obj setObject:date forKey:key];
52 if ((self = [super init])) {
63 return [NSArray arrayWithObjects:@"a", @"b", nil];
66 return [NSArray arrayWithObjects:@"c", @"d", nil];
69 - (NSCalendarDate *)weekStart {
72 ws = [NSCalendarDate dateWithString:@"2000-11-06 00:00:00 +0100"
73 calendarFormat:@"%Y-%m-%d %H:%M:%S %z"];
75 [self logWithFormat:@"couldn't create weekstart !"];
80 if (self->list == nil) {
81 WOResourceManager *rm;
84 rm = [[self application] resourceManager];
85 path = [rm pathForResourceNamed:@"appointments.plist"
89 self->list = [[NSArray alloc] initWithContentsOfFile:path];
94 for (i = 0, cnt = [self->list count]; i < cnt; i++) {
95 setDateWithKey([self->list objectAtIndex:i], @"startDate");
96 setDateWithKey([self->list objectAtIndex:i], @"endDate");
103 @end /* WeekOverview */