X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/88a036cef3585f9a6d23d074aadb2ebda0b73ff8..1fa29bdc254c03dd5026a4b72aa8312667178121:/src/common/datetime.cpp diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index b46997bbe6..45e40a6624 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -78,10 +78,27 @@ #include #include "wx/datetime.h" -#include "wx/timer.h" // for wxGetLocalTimeMillis() +#include "wx/stopwatch.h" // for wxGetLocalTimeMillis() 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")) ; +} + +WX_CUSTOM_TYPE_INFO(wxDateTime, wxToStringConverter , wxFromStringConverter) + +#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;