From 911907f4ad7a3d2751cb4abb54ec6630672abc9e Mon Sep 17 00:00:00 2001
From: Stefan Csomor <csomor@advancedconcepts.ch>
Date: Mon, 30 Mar 2009 18:26:23 +0000
Subject: [PATCH] adding OSX specific fixes to bsd level formatting problems

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 src/common/datetimefmt.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/common/datetimefmt.cpp b/src/common/datetimefmt.cpp
index 91d6452981..9f81e2d83c 100644
--- a/src/common/datetimefmt.cpp
+++ b/src/common/datetimefmt.cpp
@@ -266,11 +266,17 @@ ParseFormatAt(wxString::const_iterator& p,
 // wxDateTime to/from text representations
 // ----------------------------------------------------------------------------
 
-wxString wxDateTime::Format(const wxString& format, const TimeZone& tz) const
+wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const
 {
-    wxCHECK_MSG( !format.empty(), wxEmptyString,
+    wxCHECK_MSG( !formatp.empty(), wxEmptyString,
                  _T("NULL format in wxDateTime::Format") );
 
+    wxString format = formatp;
+#ifdef __WXOSX__
+    format.Replace("%c",wxLocale::GetInfo(wxLOCALE_DATE_TIME_FMT));
+    format.Replace("%x",wxLocale::GetInfo(wxLOCALE_SHORT_DATE_FMT));
+    format.Replace("%X",wxLocale::GetInfo(wxLOCALE_TIME_FMT));
+#endif
     // we have to use our own implementation if the date is out of range of
     // strftime() or if we use non standard specificators
 #ifdef HAVE_STRFTIME
-- 
2.47.2