Mantis 1911: Added support for shor time format in calendar view

Monotone-Parent: 3cb43f8e60e5dd474976b8e32f28cbb097744a16
Monotone-Revision: 9a9029239df8b59ccf4609e50402e80e31085154

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-08-25T15:05:01
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert
2009-08-25 15:05:01 +00:00
parent 9881f32a82
commit b7c9a59791
5 changed files with 24 additions and 3 deletions
+19 -1
View File
@@ -119,6 +119,12 @@
- (NSArray *) hoursToDisplay
{
unsigned int currentHour, lastHour;
// For later
ud = [[context activeUser] userDefaults];
timeFormat = [NSMutableString stringWithString: [ud stringForKey: @"TimeFormat"]];
if (!timeFormat || [timeFormat length] == 0)
timeFormat = [NSMutableString stringWithString: @"%H:00"];
if (!hoursToDisplay)
{
@@ -178,7 +184,19 @@
- (NSString *) currentTableHour
{
return currentTableHour;
int hour;
NSCalendarDate *tmp;
NSString *formatted = currentTableHour, *parse;
hour = [currentTableHour intValue];
parse = [NSString stringWithFormat: @"2000-01-01 %02d:00", hour];
tmp = [NSCalendarDate dateWithString: parse
calendarFormat: @"%Y-%m-%d %H:%M"];
if (tmp)
formatted = [tmp descriptionWithCalendarFormat: timeFormat];
return formatted;
}
- (NSString *) currentAppointmentHour