git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59943
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
"dghHmMsSy"
#ifdef __WXMSW__
"t"
"dghHmMsSy"
#ifdef __WXMSW__
"t"
#endif
;
for ( wxString::const_iterator p = fmt.begin(); /* end handled inside */; ++p )
#endif
;
for ( wxString::const_iterator p = fmt.begin(); /* end handled inside */; ++p )
// between 1 and 2 digits for days
fmtWX += "%d";
break;
// between 1 and 2 digits for days
fmtWX += "%d";
break;
case 3: // ddd
fmtWX += "%a";
break;
case 3: // ddd
fmtWX += "%a";
break;
case 4: // dddd
fmtWX += "%A";
break;
case 4: // dddd
fmtWX += "%A";
break;
default:
wxFAIL_MSG( "too many 'd's" );
}
break;
default:
wxFAIL_MSG( "too many 'd's" );
}
break;
+#ifndef __WXMSW__
+ case 'D':
+ switch ( lastCount )
+ {
+ case 1: // D
+ case 2: // DD
+ case 3: // DDD
+ fmtWX += "%j";
+ break;
+
+ default:
+ wxFAIL_MSG( "wrong number of 'D's" );
+ }
+ break;
+ case 'w':
+ switch ( lastCount )
+ {
+ case 1: // w
+ case 2: // ww
+ fmtWX += "%W";
+ break;
+
+ default:
+ wxFAIL_MSG( "wrong number of 'w's" );
+ }
+ break;
+ case 'E':
+ switch ( lastCount )
+ {
+ case 1: // E
+ case 2: // EE
+ case 3: // EEE
+ fmtWX += "%a";
+ break;
+ case 4: // EEEE
+ fmtWX += "%A";
+ break;
+ case 5: // EEEEE
+ fmtWX += "%a";
+ break;
+ default:
+ wxFAIL_MSG( "wrong number of 'E's" );
+ }
+ break;
+#endif
case 'M':
switch ( lastCount )
{
case 'M':
switch ( lastCount )
{
// strftime() doesn't have era string,
// ignore this format
wxASSERT_MSG( lastCount <= 2, "too many 'g's" );
// strftime() doesn't have era string,
// ignore this format
wxASSERT_MSG( lastCount <= 2, "too many 'g's" );
case 'a':
fmtWX += "%p";
break;
case 'a':
fmtWX += "%p";
break;
#ifdef __WXMSW__
case 't':
switch ( lastCount )
#ifdef __WXMSW__
case 't':
switch ( lastCount )
switch (index )
{
case wxLOCALE_SHORT_DATE_FMT:
switch (index )
{
case wxLOCALE_SHORT_DATE_FMT:
- dateStyle = kCFDateFormatterMediumStyle;
+ dateStyle = kCFDateFormatterShortStyle;
break;
case wxLOCALE_LONG_DATE_FMT:
dateStyle = kCFDateFormatterLongStyle;
break;
case wxLOCALE_DATE_TIME_FMT:
break;
case wxLOCALE_LONG_DATE_FMT:
dateStyle = kCFDateFormatterLongStyle;
break;
case wxLOCALE_DATE_TIME_FMT:
- dateStyle = kCFDateFormatterMediumStyle;
+ dateStyle = kCFDateFormatterFullStyle;
timeStyle = kCFDateFormatterMediumStyle;
break;
case wxLOCALE_TIME_FMT:
timeStyle = kCFDateFormatterMediumStyle;
break;
case wxLOCALE_TIME_FMT:
wxCFRef<CFDateFormatterRef> dateFormatter( CFDateFormatterCreate
(NULL, userLocaleRef, dateStyle, timeStyle));
wxCFStringRef cfs = wxCFRetain( CFDateFormatterGetFormat(dateFormatter ));
wxCFRef<CFDateFormatterRef> dateFormatter( CFDateFormatterCreate
(NULL, userLocaleRef, dateStyle, timeStyle));
wxCFStringRef cfs = wxCFRetain( CFDateFormatterGetFormat(dateFormatter ));
- return TranslateFromUnicodeFormat(cfs.AsString());
+ wxString format = TranslateFromUnicodeFormat(cfs.AsString());
+ // we always want full years
+ format.Replace("%y","%Y");
+ return format;