From 19058c767032643f53367d1bc11df14e2474f15f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 Mar 2013 01:12:00 +0000 Subject: [PATCH] Document wxDateTime arithmetic operators. wxDateTime::operator+() and operator-() were not documented, do it now. Also fix the return value of wxDateTime::Add(). See #15130. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- interface/wx/datetime.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/interface/wx/datetime.h b/interface/wx/datetime.h index 46106b11bf..9282ab32db 100644 --- a/interface/wx/datetime.h +++ b/interface/wx/datetime.h @@ -818,7 +818,7 @@ public: /** Adds the given date span to this object. */ - wxDateTime Add(const wxDateSpan& diff); + wxDateTime& Add(const wxDateSpan& diff); /** Adds the given time span to this object. */ @@ -863,18 +863,39 @@ public: Adds the given date span to this object. */ wxDateTime& operator+=(const wxDateSpan& diff); + /** + Adds the given date span to this object. + */ + wxDateTime operator+(const wxDateSpan& ds) const; /** Subtracts the given date span from this object. */ wxDateTime& operator-=(const wxDateSpan& diff); + /** + Subtracts the given date span from this object. + */ + wxDateTime operator-(const wxDateSpan& ds) const; /** Adds the given time span to this object. */ wxDateTime& operator+=(const wxTimeSpan& diff); + /** + Adds the given time span to this object. + */ + wxDateTime operator+(const wxTimeSpan& ts) const; /** Subtracts the given time span from this object. */ wxDateTime& operator-=(const wxTimeSpan& diff); + /** + Subtracts the given time span from this object. + */ + wxDateTime operator-(const wxTimeSpan& ts) const; + /** + Subtracts another date from this one and returns the difference between + them as a wxTimeSpan. + */ + wxTimeSpan operator-(const wxDateTime& dt2) const; //@} -- 2.45.2