]> git.saurik.com Git - wxWidgets.git/commitdiff
added another ParseFormat() overload for better backwards compatibility
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 7 Jan 2008 01:35:28 +0000 (01:35 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 7 Jan 2008 01:35:28 +0000 (01:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51062 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/datetime.h
src/common/datetime.cpp

index 1c337df30a5ab39b39d7b80dc67e6a67fc8f7257..b990cfb508af923ca19211b5b1c45b3864e476db 100644 (file)
@@ -1108,11 +1108,18 @@ public:
         return date + (end - datestr.begin());
     }
 
+    const wchar_t *ParseFormat(const wchar_t *date,
+                               const wchar_t *format = wxDefaultDateTimeFormat,
+                               const wxDateTime& dateDef = wxDefaultDateTime)
+    {
+        return ParseFormat(date, wxString(format), dateDef);
+    }
+
     const char *ParseFormat(const char *date,
-                            const wxString& format = wxDefaultDateTimeFormat,
+                            const char *format = wxDefaultDateTimeFormat,
                             const wxDateTime& dateDef = wxDefaultDateTime)
     {
-        return ParseFormat(wxString(date), format, dateDef);
+        return ParseFormat(wxString(date), wxString(format), dateDef);
     }
 
         // parse a string containing the date/time in "free" format, this
index 5614ae84c0a25c13fd2f8958938cbd46b1e7c795..948b3e6f26e3ed18f286096672a41a799f55b10d 100644 (file)
@@ -3395,7 +3395,7 @@ wxDateTime::ParseFormat(const wxString& date,
             case _T('r'):       // time as %I:%M:%S %p
                 {
                     wxDateTime dt;
-                    input = dt.ParseFormat(input, _T("%I:%M:%S %p"));
+                    input = dt.ParseFormat(input, wxS("%I:%M:%S %p"));
                     if ( !input )
                     {
                         // no match
@@ -3414,7 +3414,7 @@ wxDateTime::ParseFormat(const wxString& date,
             case _T('R'):       // time as %H:%M
                 {
                     wxDateTime dt;
-                    input = dt.ParseFormat(input, _T("%H:%M"));
+                    input = dt.ParseFormat(input, wxS("%H:%M"));
                     if ( !input )
                     {
                         // no match