Respect time locale in days views

pull/210/head
Francis Lachapelle 2016-05-17 16:22:50 -04:00
parent 87fbedb89d
commit d17944091a
3 changed files with 14 additions and 7 deletions

View File

@ -37,7 +37,8 @@
{
SOGoDateFormatter *dateFormatter;
NSArray *weekDays;
NSString *currentView, *timeFormat, *currentTableHour;
NSString *currentView, *timeFormat;
NSNumber *currentTableHour;
NSCalendarDate *startDate, *currentTableDay;
NSMutableArray *daysToDisplay, *calendarsToDisplay, *hoursToDisplay;
NSMutableDictionary *currentCalendar;

View File

@ -255,16 +255,21 @@
return currentCalendar;
}
- (void) setCurrentTableHour: (NSString *) aTableHour
- (void) setCurrentTableHour: (NSNumber *) aTableHour
{
currentTableHour = aTableHour;
ASSIGN(currentTableHour, aTableHour);
}
- (NSString *) currentTableHour
- (NSNumber *) currentTableHour
{
return currentTableHour;
}
- (NSString *) currentFormattedHour
{
int hour;
NSCalendarDate *tmp;
NSString *formatted = currentTableHour, *parse;
NSString *formatted = [NSString stringWithFormat: @"%d", [currentTableHour intValue]], *parse;
hour = [currentTableHour intValue];
parse = [NSString stringWithFormat: @"2000-01-01 %02d:00", hour];
@ -272,7 +277,8 @@
tmp = [NSCalendarDate dateWithString: parse
calendarFormat: @"%Y-%m-%d %H:%M"];
if (tmp)
formatted = [tmp descriptionWithCalendarFormat: timeFormat];
formatted = [tmp descriptionWithCalendarFormat: timeFormat
locale: locale];
return formatted;
}

View File

@ -91,7 +91,7 @@
<div class="hours">
<var:foreach list="hoursToDisplay" item="currentTableHour">
<div class="hour" var:id="currentHourId">
<var:string value="currentTableHour"/>
<var:string value="currentFormattedHour"/>
</div>
</var:foreach>
</div>