X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..58ce18f2fdadecffb21e27555115af708325cf18:/include/wx/generic/calctrlg.h?ds=sidebyside diff --git a/include/wx/generic/calctrlg.h b/include/wx/generic/calctrlg.h index 8d115cac8f..02abe01210 100644 --- a/include/wx/generic/calctrlg.h +++ b/include/wx/generic/calctrlg.h @@ -199,15 +199,29 @@ private: // get the date from which we start drawing days wxDateTime GetStartDate() const; + // get the first/last days of the week corresponding to the current style + wxDateTime::WeekDay GetWeekStart() const + { + return HasFlag(wxCAL_MONDAY_FIRST) ? wxDateTime::Mon + : wxDateTime::Sun; + } + + wxDateTime::WeekDay GetWeekEnd() const + { + return HasFlag(wxCAL_MONDAY_FIRST) ? wxDateTime::Sun + : wxDateTime::Sat; + } + + // is this date shown? bool IsDateShown(const wxDateTime& date) const; - // is this date in the given range? + // is this date in the currently allowed range? bool IsDateInRange(const wxDateTime& date) const; - // range helpers - bool ChangeYear(wxDateTime* target) const; - bool ChangeMonth(wxDateTime* target) const; + // adjust the date to the currently allowed range, return true if it was + // changed + bool AdjustDateToRange(wxDateTime *date) const; // redraw the given date void RefreshDate(const wxDateTime& date);