X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c28a4e5fa598ac3eabb82ed507a8010137fca170..404b319a85dadd7decf7a5a5331020520031a41c:/src/generic/timectrlg.cpp diff --git a/src/generic/timectrlg.cpp b/src/generic/timectrlg.cpp index b3d0e5acaf..f6aaa2317e 100644 --- a/src/generic/timectrlg.cpp +++ b/src/generic/timectrlg.cpp @@ -131,6 +131,17 @@ public: { m_time = time.IsValid() ? time : wxDateTime::Now(); + // Ensure that the date part doesn't correspond to a DST change date as + // time is discontinuous then resulting in many problems, e.g. it's + // impossible to even enter 2:00:00 at the beginning of summer time + // date as this time doesn't exist. By using Jan 1, on which nobody + // changes DST, we avoid all such problems. + wxDateTime::Tm tm = m_time.GetTm(); + tm.mday = + tm.yday = 1; + tm.mon = wxDateTime::Jan; + m_time.Set(tm); + UpdateTextWithoutEvent(); } @@ -259,7 +270,7 @@ private: void OnTextClick(wxMouseEvent& event) { - Field field wxDUMMY_INITIALIZE(Field_Max); + Field field = Field_Max; // Initialize just to suppress warnings. long pos; switch ( m_text->HitTest(event.GetPosition(), &pos) ) {