Automatically determine the first weekday for a calendar control
If neither wxCAL_SUNDAY_FIRST or wxCAL_MONDAY_FIRST was given, use wxDateTime::GetFirstWeekDay() to automatically determine the preferred day. This changes the earlier default behaviour, which was to use Sunday if not otherwise specified. However, the wxGTK native calendar control ignored this behaviour anyway.
This commit is contained in:
@@ -202,13 +202,13 @@ private:
|
||||
// get the first/last days of the week corresponding to the current style
|
||||
wxDateTime::WeekDay GetWeekStart() const
|
||||
{
|
||||
return HasFlag(wxCAL_MONDAY_FIRST) ? wxDateTime::Mon
|
||||
return WeekStartsOnMonday() ? wxDateTime::Mon
|
||||
: wxDateTime::Sun;
|
||||
}
|
||||
|
||||
wxDateTime::WeekDay GetWeekEnd() const
|
||||
{
|
||||
return HasFlag(wxCAL_MONDAY_FIRST) ? wxDateTime::Sun
|
||||
return WeekStartsOnMonday() ? wxDateTime::Sun
|
||||
: wxDateTime::Sat;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user