]> err.no Git - scalable-opengroupware.org/blob - SOGo/UI/Scheduler/UIxCalWeekView.m
be5b8897c3821576eccb1af335f41f1a9e91a4c3
[scalable-opengroupware.org] / SOGo / UI / Scheduler / UIxCalWeekView.m
1 // $Id$
2
3 #include "UIxCalWeekView.h"
4 #include "common.h"
5
6 @implementation UIxCalWeekView
7
8 - (NSCalendarDate *)startDate {
9     return [[[super startDate] mondayOfWeek] beginOfDay];
10 }
11
12 - (NSCalendarDate *)endDate {
13     unsigned offset;
14     
15     if([self shouldDisplayWeekend])
16         offset = 7;
17     else
18         offset = 5;
19   return [[[self startDate] dateByAddingYears:0 months:0 days:offset
20                             hours:0 minutes:0 seconds:0]
21                             endOfDay];
22 }
23
24 - (NSArray *)appointments {
25   return [self fetchCoreInfos];
26 }
27
28 /* URLs */
29
30 - (NSDictionary *)prevWeekQueryParameters {
31   NSCalendarDate *date;
32
33   date = [[self startDate] dateByAddingYears:0 months:0 days:-7 
34                            hours:0 minutes:0 seconds:0];
35   return [self queryParametersBySettingSelectedDate:date];
36 }
37
38 - (NSDictionary *)nextWeekQueryParameters {
39   NSCalendarDate *date;
40     
41   date = [[self startDate] dateByAddingYears:0 months:0 days:7 
42                            hours:0 minutes:0 seconds:0];
43   return [self queryParametersBySettingSelectedDate:date];
44 }
45
46 @end /* UIxCalWeekView */