Add wxDateTime::DiffAsDateSpan().
This method returns the difference between the dates as wxDateSpan, unlike the existing Subtract() and overloaded operator-() that return wxTimeSpan. Closes #14704. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72600 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -20,6 +20,17 @@ inline std::ostream& operator<<(std::ostream& ostr, const wxDateTime& dt)
|
||||
return ostr;
|
||||
}
|
||||
|
||||
// need this to be able to use CPPUNIT_ASSERT_EQUAL with wxDateSpan objects
|
||||
inline std::ostream& operator<<(std::ostream& ostr, const wxDateSpan& span)
|
||||
{
|
||||
ostr << span.GetYears() << "Y, "
|
||||
<< span.GetMonths() << "M, "
|
||||
<< span.GetWeeks() << "W, "
|
||||
<< span.GetDays() << "D";
|
||||
|
||||
return ostr;
|
||||
}
|
||||
|
||||
WX_CPPUNIT_ALLOW_EQUALS_TO_INT(wxDateTime::wxDateTime_t)
|
||||
|
||||
#endif // _WX_TESTS_TESTDATE_H_
|
||||
|
Reference in New Issue
Block a user