]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datetime.cpp
Allow wxWANTS_CHARS to be effective on native controls too
[wxWidgets.git] / src / common / datetime.cpp
index 43b767754eb6984b995446bd28dcb1eaa1fcfe13..c40dedee2b2842d14dac35edec5add9f1af31f26 100644 (file)
@@ -1496,6 +1496,16 @@ wxDateTime& wxDateTime::ResetTime()
     return *this;
 }
 
+wxDateTime wxDateTime::GetDateOnly() const
+{
+    Tm tm = GetTm();
+    tm.msec =
+    tm.sec =
+    tm.min =
+    tm.hour = 0;
+    return wxDateTime(tm);
+}
+
 // ----------------------------------------------------------------------------
 // DOS Date and Time Format functions
 // ----------------------------------------------------------------------------
@@ -2472,7 +2482,7 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
                         // replace all occurrences of year with it
                         bool wasReplaced = fmt2.Replace(strYear, replacement) > 0;
                         // evaluation order ensures we always attempt the replacement.
-                        wasReplaced = (fmt2.Replace(strYear2, replacement2) > 0) | wasReplaced ;
+                        wasReplaced = (fmt2.Replace(strYear2, replacement2) > 0) || wasReplaced;
 
                         // use strftime() to format the same date but in supported
                         // year