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
maint-2.0.2
C Robert 2009-08-25 15:05:01 +00:00
parent 9881f32a82
commit b7c9a59791
5 changed files with 24 additions and 3 deletions

View File

@ -2,6 +2,7 @@
* SoObjects/Contacts/SOGoContactGCSList.m (copyToFolder): Implementation to
support copying lists.
* UI/Scheduler/UIxCalDayTable.m: Added support for TimeFormat default.
2009-08-24 Cyril Robert <crobert@inverse.ca>

View File

@ -43,6 +43,8 @@
NSMutableArray *hoursToDisplay;
NSArray *weekDays;
SOGoDateFormatter *dateFormatter;
NSUserDefaults *ud;
NSMutableString *timeFormat;
}
- (void) setNumberOfDays: (NSNumber *) aNumber;

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

View File

@ -28,7 +28,7 @@
<div id="daysView" var:class="daysViewClasses">
<div class="hours">
<var:foreach list="hoursToDisplay" item="currentTableHour"
><div class="hour"><var:string value="currentTableHour" />:00</div
><div class="hour"><var:string value="currentTableHour" /></div
></var:foreach>
</div>

View File

@ -533,7 +533,7 @@ function initTabIndex(addressList, subjectField, msgArea) {
}
function initMailEditor() {
if (composeMode != "html")
if (composeMode != "html" && $("text"))
$("text").style.display = "block";
var list = $("attachments");