From 4bd66c948b16cd17863ca06e6dfc7a22cc964fac Mon Sep 17 00:00:00 2001 From: Danny Thuering Date: Tue, 31 Jan 2012 13:42:25 +0100 Subject: [PATCH] NSDateFormatter for header month name uses prefered locale --- src/KalLogic.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/KalLogic.m b/src/KalLogic.m index c15e161..89c273d 100644 --- a/src/KalLogic.m +++ b/src/KalLogic.m @@ -34,6 +34,10 @@ - (id)initForDate:(NSDate *)date { if ((self = [super init])) { monthAndYearFormatter = [[NSDateFormatter alloc] init]; + NSString *localeString = [[NSLocale preferredLanguages] objectAtIndex:0]; + NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:localeString]; + [monthAndYearFormatter setLocale:locale]; + [locale release]; [monthAndYearFormatter setDateFormat:@"LLLL yyyy"]; [self moveToMonthForDate:date]; }