deprecated SetToTheWeek() and GetWeek(); added and documented new and well-defined SetToWeekOfYear()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-09-11 22:07:10 +00:00
parent 1c5d27e2ab
commit 4c27e2faf3
4 changed files with 199 additions and 45 deletions

View File

@@ -448,8 +448,15 @@ for n in range(20):
CPPUNIT_ASSERT( wmon2 == wn.wmon2 );
CPPUNIT_ASSERT( week == wn.week );
wxDateTime dt2(1, wxDateTime::Jan, d.year);
dt2.SetToTheWeek(wn.week, dt.GetWeekDay());
int year = d.year;
if ( week == 1 && d.month != wxDateTime::Jan )
{
// this means we're in the first week of the next year
year++;
}
wxDateTime
dt2 = wxDateTime::SetToWeekOfYear(year, week, dt.GetWeekDay());
CPPUNIT_ASSERT( dt2 == dt );
}
}