X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c2882d9e1b17c600a196e1b69fbe66b98204151..c7ce8392e0fa752d121000b7732c8f4ac3e3088d:/include/wx/date.h?ds=sidebyside diff --git a/include/wx/date.h b/include/wx/date.h index 1b3f2e7788..09e8e00c49 100644 --- a/include/wx/date.h +++ b/include/wx/date.h @@ -81,8 +81,8 @@ public: long operator-(const wxDate &dt) const { return GetJulianDate() - dt.GetJulianDate(); } - wxDate &operator+=(long i) { m_date += wxTimeSpan::Days(i); return *this; } - wxDate &operator-=(long i) { m_date -= wxTimeSpan::Days(i); return *this; } + wxDate &operator+=(long i) { m_date += wxTimeSpan::Days((int)i); return *this; } + wxDate &operator-=(long i) { m_date -= wxTimeSpan::Days((int)i); return *this; } wxDate &operator++() { return *this += 1; } wxDate &operator++(int) { return *this += 1; } @@ -161,16 +161,16 @@ public: int GetMonth() const { return m_date.GetMonth() + 1; } // First Date Of Month - wxDate GetMonthStart() const { return(wxDate(GetMonth(), 1, GetYear())); } + wxDate GetMonthStart() const { return(wxDate(GetMonth()-1, 1, GetYear())); } // Last Date Of Month - wxDate GetMonthEnd() const { return wxDate(GetMonth()+1, 1, GetYear())-1; } + wxDate GetMonthEnd() const { return wxDate(GetMonth(), 1, GetYear())-1; } // eg. 1992 int GetYear() const { return m_date.GetYear(); } // First Date Of Year - wxDate GetYearStart() const { return wxDate(1, 1, GetYear()); } + wxDate GetYearStart() const { return wxDate(0, 1, GetYear()); } // Last Date Of Year - wxDate GetYearEnd() const { return wxDate(1, 1, GetYear()+1) - 1; } + wxDate GetYearEnd() const { return wxDate(0, 1, GetYear()+1) - 1; } bool IsBetween(const wxDate& first, const wxDate& second) const {