Respect time locale in days views

This commit is contained in:
Francis Lachapelle
2016-05-17 16:22:50 -04:00
parent 87fbedb89d
commit d17944091a
3 changed files with 14 additions and 7 deletions
+11 -5
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;
}