Author: jpobst
Date: 2007-09-19 21:48:24 -0400 (Wed, 19 Sep 2007)
New Revision: 86057

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateTimePicker.cs
   trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DateTimePickerTest.cs
Log:
2007-09-19  Jonathan Pobst  <[EMAIL PROTECTED]>

        * DateTimePicker.cs: If the user sets MinDate to DateTime.MinValue,
        change it to DateTimePicker.MinDateTime.  [Fixes bug #326609]

2007-09-19  Jonathan Pobst  <[EMAIL PROTECTED]>

        * DateTimePickerTest.cs: Add test for bug #326609.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-09-19 23:59:45 UTC (rev 86056)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-09-20 01:48:24 UTC (rev 86057)
@@ -1,5 +1,10 @@
 2007-09-19  Jonathan Pobst  <[EMAIL PROTECTED]>
 
+       * DateTimePicker.cs: If the user sets MinDate to DateTime.MinValue,
+       change it to DateTimePicker.MinDateTime.  [Fixes bug #326609]
+
+2007-09-19  Jonathan Pobst  <[EMAIL PROTECTED]>
+
        * Theme.cs: FileDialogs should be using DesktopDirectory instead of
        Desktop.  This lets it work for people who have moved their desktops
        from the default location on windows.  For people who have not, both

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateTimePicker.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateTimePicker.cs    
    2007-09-19 23:59:45 UTC (rev 86056)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateTimePicker.cs    
    2007-09-20 01:48:24 UTC (rev 86057)
@@ -440,6 +440,11 @@
                
                public DateTime MinDate {
                        set {
+                               // If the user tries to set DateTime.MinValue, 
fix it to
+                               // DateTimePicker's minimum.
+                               if (value == DateTime.MinValue)
+                                       value = MinDateTime;
+                                       
 #if NET_2_0
                                if (value > MaxDate) {
 #else

Modified: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2007-09-19 23:59:45 UTC (rev 86056)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2007-09-20 01:48:24 UTC (rev 86057)
@@ -1,3 +1,7 @@
+2007-09-19  Jonathan Pobst  <[EMAIL PROTECTED]>
+
+       * DateTimePickerTest.cs: Add test for bug #326609.
+
 2007-09-14  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * ToolStripTest.cs: Asserts showing Selectable control style depends

Modified: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DateTimePickerTest.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DateTimePickerTest.cs
       2007-09-19 23:59:45 UTC (rev 86056)
+++ 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DateTimePickerTest.cs
       2007-09-20 01:48:24 UTC (rev 86057)
@@ -3263,6 +3263,17 @@
                }
 
                [Test]
+               public void DateTimeMinDate ()
+               {
+                       DateTimePicker dt = new DateTimePicker ();
+
+                       // MinDate can be set to DateTime.MinValue, which sets 
MinDate to
+                       // DateTimePicker.MinDateTime
+                       dt.MinDate = DateTime.MinValue;
+                       Assert.AreEqual (DateTimePicker.MinimumDateTime, 
dt.MinDate, "A1");
+               }
+               
+               [Test]
                public void MinDate_Invalid ()
                {
                        DateTimePicker dt = new DateTimePicker ();

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to