From 2716347f175a71d7908befa620ea3e5818290841 Mon Sep 17 00:00:00 2001 From: dghart Date: Sat, 26 Jan 2019 20:55:20 +0000 Subject: [PATCH 1/2] Correct the order of parameters in the wxDateTime::SetToWeekDay examples e.g. "For example, SetToWeekDay(wxDateTime::Wed, 2)" not "For example, SetToWeekDay(2, wxDateTime::Wed)" --- interface/wx/datetime.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/wx/datetime.h b/interface/wx/datetime.h index 48b941b7b2..da7ef4a59a 100644 --- a/interface/wx/datetime.h +++ b/interface/wx/datetime.h @@ -1161,9 +1161,9 @@ public: @a n may be either positive (counting from the beginning of the month) or negative (counting from the end of it). - For example, SetToWeekDay(2, wxDateTime::Wed) will set the date to the + For example, SetToWeekDay(wxDateTime::Wed, 2) will set the date to the second Wednesday in the current month and - SetToWeekDay(-1, wxDateTime::Sun) will set the date to the last Sunday + SetToWeekDay(wxDateTime::Sun, -1) will set the date to the last Sunday in the current month. @return @true if the date was modified successfully, @false otherwise From 8e4b492cf4f675562aee31a59242d7a8516feba0 Mon Sep 17 00:00:00 2001 From: dghart Date: Sat, 26 Jan 2019 21:12:07 +0000 Subject: [PATCH 2/2] Clarify what happens if the wxDateTime::SetToWeekDay month and/or year parameters are left as the default Inv_Month/Inv_Year This causes the month and/or year being set to their wxDateTime::Now values, even if the original values in the wxDateTime object were valid. --- interface/wx/datetime.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/wx/datetime.h b/interface/wx/datetime.h index da7ef4a59a..53595c78be 100644 --- a/interface/wx/datetime.h +++ b/interface/wx/datetime.h @@ -1166,6 +1166,10 @@ public: SetToWeekDay(wxDateTime::Sun, -1) will set the date to the last Sunday in the current month. + Note that leaving the month or year parameters as their default values + will result in the current month or year being substituted, overwriting + any previous values in the wxDateTime object. + @return @true if the date was modified successfully, @false otherwise meaning that the specified date doesn't exist. */