+ {
+ CFDateFormatterStyle dateStyle = kCFDateFormatterNoStyle;
+ CFDateFormatterStyle timeStyle = kCFDateFormatterNoStyle;
+ switch (index )
+ {
+ case wxLOCALE_SHORT_DATE_FMT:
+ dateStyle = kCFDateFormatterShortStyle;
+ break;
+ case wxLOCALE_LONG_DATE_FMT:
+ dateStyle = kCFDateFormatterFullStyle;
+ break;
+ case wxLOCALE_DATE_TIME_FMT:
+ dateStyle = kCFDateFormatterFullStyle;
+ timeStyle = kCFDateFormatterMediumStyle;
+ break;
+ case wxLOCALE_TIME_FMT:
+ timeStyle = kCFDateFormatterMediumStyle;
+ break;
+ default:
+ wxFAIL_MSG( "unexpected time locale" );
+ return wxString();
+ }
+ wxCFRef<CFDateFormatterRef> dateFormatter( CFDateFormatterCreate
+ (NULL, userLocaleRef, dateStyle, timeStyle));
+ wxCFStringRef cfs = wxCFRetain( CFDateFormatterGetFormat(dateFormatter ));
+ wxString format = TranslateFromUnicodeFormat(cfs.AsString());
+ // we always want full years
+ format.Replace("%y","%Y");
+ return format;
+ }
+ break;