Respect time locale in days views
parent
87fbedb89d
commit
d17944091a
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue