mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-11 11:25:12 +00:00
Monotone-Parent: 6f3f424424e1dc4ae51e22f8072993e3bd8ff14a
Monotone-Revision: f69d60b9d521e7955f8e0a7051cb02f730a5b031 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-31T23:01:12 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -20,11 +20,13 @@
|
||||
*/
|
||||
// $Id: UIxCalInlineAptView.m 885 2005-07-21 16:41:34Z znek $
|
||||
|
||||
#import <Foundation/NSDictionary.h>
|
||||
|
||||
#import <NGObjWeb/NGObjWeb.h>
|
||||
|
||||
@interface UIxCalInlineAptView : WOComponent
|
||||
{
|
||||
id appointment;
|
||||
NSDictionary *appointment;
|
||||
id formatter;
|
||||
id tooltipFormatter;
|
||||
id url;
|
||||
@@ -54,10 +56,10 @@
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)setAppointment:(id)_appointment {
|
||||
- (void) setAppointment: (NSDictionary *)_appointment {
|
||||
ASSIGN(appointment, _appointment);
|
||||
}
|
||||
- (id)appointment {
|
||||
- (NSDictionary *)appointment {
|
||||
return appointment;
|
||||
}
|
||||
|
||||
@@ -146,6 +148,35 @@
|
||||
[appointment objectForKey: @"owner"]];
|
||||
}
|
||||
|
||||
- (NSString *) displayStyle
|
||||
{
|
||||
NSCalendarDate *startDate, *endDate, *dayStart, *dayEnd;
|
||||
int sSeconds, eSeconds, deltaMinutes;
|
||||
unsigned int height;
|
||||
NSTimeZone *uTZ;
|
||||
|
||||
uTZ = [referenceDate timeZone];
|
||||
dayStart = [referenceDate beginOfDay];
|
||||
dayEnd = [referenceDate endOfDay];
|
||||
|
||||
sSeconds = [[appointment objectForKey: @"startdate"] intValue];
|
||||
eSeconds = [[appointment objectForKey: @"enddate"] intValue];
|
||||
startDate = [NSCalendarDate dateWithTimeIntervalSince1970: sSeconds];
|
||||
[startDate setTimeZone: uTZ];
|
||||
if ([startDate earlierDate: dayStart] == startDate)
|
||||
startDate = dayStart;
|
||||
endDate = [NSCalendarDate dateWithTimeIntervalSince1970: eSeconds];
|
||||
[endDate setTimeZone: uTZ];
|
||||
if ([endDate earlierDate: dayEnd] == dayEnd)
|
||||
endDate = dayEnd;
|
||||
|
||||
deltaMinutes = (([endDate hourOfDay] - [startDate hourOfDay]) * 60
|
||||
+ [endDate minuteOfHour] - [startDate minuteOfHour]);
|
||||
height = ceil(deltaMinutes / 15) * 25;
|
||||
|
||||
return [NSString stringWithFormat: @"height: %d%%;", height];
|
||||
}
|
||||
|
||||
/* helpers */
|
||||
|
||||
- (NSString *) title
|
||||
|
||||
Reference in New Issue
Block a user