Permalink
Browse files

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

svn path=/trunk/mcs/; revision=66593
  • Loading branch information...
1 parent 4a9b506 commit 43013462fdbc0cb2d0a3553ee0a32a91df47608e @rolfbjarne rolfbjarne committed Oct 12, 2006
View
6 mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
@@ -1,5 +1,11 @@
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>
+
* DateTimePicker.cs
* MonthCalendar.cs
* ThemeWin32Classic.cs: rewrote DateTimePicker to fix bug #78364
View
2 mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs
@@ -1389,7 +1389,7 @@ private void AddTimeToSelection (int delta, bool isDays)
// convert a Day enum into a DayOfWeek enum
internal DayOfWeek GetDayOfWeek (Day day) {
if (day == Day.Default) {
- return DayOfWeek.Sunday;
+ return Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.FirstDayOfWeek;
} else {
return (DayOfWeek) DayOfWeek.Parse (typeof (DayOfWeek), day.ToString ());
}
View
3 mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
@@ -2484,6 +2484,7 @@ private void DrawSingleMonth(Graphics dc, Rectangle clip_rectangle, Rectangle re
Size title_size = (Size)((object)mc.title_size);
Size date_cell_size = (Size)((object)mc.date_cell_size);
DateTime current_month = (DateTime)((object)mc.current_month);
+ DateTime sunday = new DateTime(2006, 10, 1);
// draw the title back ground
DateTime this_month = current_month.AddMonths (row*mc.CalendarDimensions.Width+col);
@@ -2545,7 +2546,7 @@ private void DrawSingleMonth(Graphics dc, Rectangle clip_rectangle, Rectangle re
day_name_rect.Y,
date_cell_size.Width,
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

0 comments on commit 4301346

Please sign in to comment.