Navigation Menu

Skip to content

Commit

Permalink
2006-10-12 Rolf Bjarne Kvinge <rolfkvinge@ya.com>
Browse files Browse the repository at this point in the history
	* MonthCalendar.cs: When FirstDayOfWeek is default set firstday 
	to ui thread's settings instead of sunday. 
	* ThemeWin32Classic.cs: Localize the day string. Fixes #79563

svn path=/trunk/mcs/; revision=66593
  • Loading branch information
rolfbjarne committed Oct 12, 2006
1 parent 4a9b506 commit 4301346
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
@@ -1,3 +1,9 @@
2006-10-12 Rolf Bjarne Kvinge <rolfkvinge@ya.com>

* MonthCalendar.cs: When FirstDayOfWeek is default set firstday
to ui thread's settings instead of sunday.
* ThemeWin32Classic.cs: Localize the day string. Fixes #79563

2006-10-12 Rolf Bjarne Kvinge <rolfkvinge@ya.com> 2006-10-12 Rolf Bjarne Kvinge <rolfkvinge@ya.com>


* DateTimePicker.cs * DateTimePicker.cs
Expand Down
Expand Up @@ -1389,7 +1389,7 @@ private void AddTimeToSelection (int delta, bool isDays)
// convert a Day enum into a DayOfWeek enum // convert a Day enum into a DayOfWeek enum
internal DayOfWeek GetDayOfWeek (Day day) { internal DayOfWeek GetDayOfWeek (Day day) {
if (day == Day.Default) { if (day == Day.Default) {
return DayOfWeek.Sunday; return Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.FirstDayOfWeek;
} else { } else {
return (DayOfWeek) DayOfWeek.Parse (typeof (DayOfWeek), day.ToString ()); return (DayOfWeek) DayOfWeek.Parse (typeof (DayOfWeek), day.ToString ());
} }
Expand Down
Expand Up @@ -2484,6 +2484,7 @@ private void DrawSingleMonth(Graphics dc, Rectangle clip_rectangle, Rectangle re
Size title_size = (Size)((object)mc.title_size); Size title_size = (Size)((object)mc.title_size);
Size date_cell_size = (Size)((object)mc.date_cell_size); Size date_cell_size = (Size)((object)mc.date_cell_size);
DateTime current_month = (DateTime)((object)mc.current_month); DateTime current_month = (DateTime)((object)mc.current_month);
DateTime sunday = new DateTime(2006, 10, 1);


// draw the title back ground // draw the title back ground
DateTime this_month = current_month.AddMonths (row*mc.CalendarDimensions.Width+col); DateTime this_month = current_month.AddMonths (row*mc.CalendarDimensions.Width+col);
Expand Down Expand Up @@ -2545,7 +2546,7 @@ private void DrawSingleMonth(Graphics dc, Rectangle clip_rectangle, Rectangle re
day_name_rect.Y, day_name_rect.Y,
date_cell_size.Width, date_cell_size.Width,
date_cell_size.Height); date_cell_size.Height);
dc.DrawString (((DayOfWeek)i).ToString().Substring(0, 3), mc.Font, ResPool.GetSolidBrush (mc.TitleBackColor), day_rect, mc.centered_format); dc.DrawString (sunday.AddDays (i + (int) first_day_of_week).ToString ("ddd"), mc.Font, ResPool.GetSolidBrush (mc.TitleBackColor), day_rect, mc.centered_format);
} }


// draw the vertical divider // draw the vertical divider
Expand Down

0 comments on commit 4301346

Please sign in to comment.