]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datetime.cpp
wxUniversal STL-ification.
[wxWidgets.git] / src / common / datetime.cpp
index 19236b62d8b89280f71bdad3b2d7035780106145..c671694698c6a09eb3e7dbcc9a1434a9f992f564 100644 (file)
 
 const long wxDateTime::TIME_T_FACTOR = 1000l;
 
+#if wxUSE_EXTENDED_RTTI
+
+template<> void wxStringReadValue(const wxString &s , wxDateTime &data )
+{
+    data.ParseFormat(s,wxT("%Y-%m-%d %H:%M:%S")) ;
+}
+
+template<> void wxStringWriteValue(wxString &s , const wxDateTime &data )
+{
+    s = data.Format(wxT("%Y-%m-%d %H:%M:%S")) ;
+}
+
+wxCUSTOM_TYPE_INFO(wxDateTime, wxToStringConverter<wxDateTime> , wxFromStringConverter<wxDateTime>)
+
+#endif
+
+//
 // ----------------------------------------------------------------------------
 // conditional compilation
 // ----------------------------------------------------------------------------
@@ -3469,8 +3486,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
                 mon = (wxDateTime::Month)(day - 1);
 
                 // we're in the current year then
-                if ( (year > 0) &&
-                        (unsigned)year <= GetNumOfDaysInMonth(Inv_Year, mon) )
+                if ( (year > 0) && (year <= (int)GetNumOfDaysInMonth(Inv_Year, mon)) )
                 {
                     day = year;