]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed wxDateTime::GetWeekDayName() for wday > Wed (patch 998646)
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Jul 2004 23:33:16 +0000 (23:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Jul 2004 23:33:16 +0000 (23:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28553 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/common/datetime.cpp

index 1dfe757d4753faea07e11905989d540e4ededda1..6f07c51e25ac0f14115f958e3a1d849a76b1a4cf 100644 (file)
@@ -205,6 +205,7 @@ All:
   (based on patch by Stefan Kowski)
 - added wxMicroSleep() and wxMilliSleep() replacing deprecated wxUsleep()
 - basic UDP sockets support (Lenny Maiorani)
+- fixed wxDateTime::GetWeekDayName() for some dates (Daniel Kaps)
 
 All (GUI):
 
index 2b208928df69644e5bb338f75205c87088e60514..3ac780395fb5258a3f7937e2f9767a8634448e6c 100644 (file)
@@ -817,10 +817,12 @@ wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday,
 {
     wxCHECK_MSG( wday != Inv_WeekDay, _T(""), _T("invalid weekday") );
 
-    // take some arbitrary Sunday
+    // take some arbitrary Sunday (but notice that the day should be such that
+    // after adding wday to it below we still have a valid date, e.g. don't
+    // take 28 here!)
     tm tm;
     InitTm(tm);
-    tm.tm_mday = 28;
+    tm.tm_mday = 21;
     tm.tm_mon = Nov;
     tm.tm_year = 99;