NSDateFormatter strings in iOS 7

Trying to format the date in iOS 7 and get unexpected results for the day of the week. Apple's documentation does not display templates for iOS 7, but the templates provided for iOS 6 are here . Looking at the weekly section of the week

Day of the week — Use one to three letters in a short day, or four for a full name or five for a narrow name.

However, I can not get the format string with the full name of 4 letters.

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"EEE"];
NSLog(@"%@", [formatter stringFromDate:date]);

prints "Wed"

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"EEEE"];
NSLog(@"%@", [formatter stringFromDate:date]);

also prints "Wed", should print "medium"

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"EEEEE"];
NSLog(@"%@", [formatter stringFromDate:date]);

prints "W"

Is there a new set of formatting strings that should be used for iOS 7, or am I doing something wrong?

+4
source share
2

, .

, .

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
// or
NSLocale *locale = [NSLocale currentLocale];
[formatter setLocale:locale];
[formatter setDateFormat:@"EEEE"];
NSLog(@"%@", [formatter stringFromDate:date]);
+5

Unicode standard ( 18 2013 .), EEEE.

, . iOS , , . NSLocale .

0

All Articles