X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/479cd5de40ca8029c79e780170fa7c0af7ec0297..edb8f2985fc838f92c60d9efd42462441f3caea9:/include/wx/date.h diff --git a/include/wx/date.h b/include/wx/date.h index 11ff72017f..b3b8dd9779 100644 --- a/include/wx/date.h +++ b/include/wx/date.h @@ -55,7 +55,7 @@ public: wxDate(long j) : m_date((double)(j + 0.5)) { Init(); } wxDate(int m, int d, int y) : m_date(d, (wxDateTime::Month)m, y) { Init(); } wxDate(const wxString& dat) { Init(); (void)m_date.ParseDate(dat); } - wxDate(const wxDate &date) { *this = date; } + wxDate(const wxDate &date) : wxObject() { *this = date; } wxDate(const wxDateTime& dt) { Init(); m_date = dt; } @@ -90,7 +90,7 @@ public: wxDate &operator--(int) { return *this -= 1; } #if wxUSE_STD_IOSTREAM - friend ostream WXDLLEXPORT & operator <<(ostream &os, const wxDate &dt) + friend wxSTD ostream WXDLLEXPORT & operator <<(wxSTD ostream &os, const wxDate &dt) { return os << dt.FormatDate().mb_str(); } #endif @@ -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 {