CVSROOT:        /sources/dotgnu-pnet
Module name:    pnetlib
Branch:         
Changes by:     Heiko Weiss <[EMAIL PROTECTED]> 06/02/03 06:28:59

Modified files:
        .              : ChangeLog 
        runtime/System : DateTime.cs 

Log message:
        fixed exception in AddMonths, if the new month has less days then the 
old month

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/pnetlib/ChangeLog.diff?tr1=1.2349&tr2=1.2350&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/pnetlib/runtime/System/DateTime.cs.diff?tr1=1.28&tr2=1.29&r1=text&r2=text

Patches:
Index: pnetlib/ChangeLog
diff -u pnetlib/ChangeLog:1.2349 pnetlib/ChangeLog:1.2350
--- pnetlib/ChangeLog:1.2349    Wed Feb  1 10:30:33 2006
+++ pnetlib/ChangeLog   Fri Feb  3 06:28:59 2006
@@ -1,3 +1,7 @@
+2006-02-03  Peter Flaig  <[EMAIL PROTECTED]>
+
+       * runtime/System/DateTime.cs: fixed exception in AddMonths, if the new 
month has less days then the old month
+
 2006-02-01  Heiko Weiss <[EMAIL PROTECTED]>
 
        * System.Windows.Forms/TreeNode.cs: fixed some NullReferenceException
Index: pnetlib/runtime/System/DateTime.cs
diff -u pnetlib/runtime/System/DateTime.cs:1.28 
pnetlib/runtime/System/DateTime.cs:1.29
--- pnetlib/runtime/System/DateTime.cs:1.28     Sat Jul 26 05:43:30 2003
+++ pnetlib/runtime/System/DateTime.cs  Fri Feb  3 06:28:59 2006
@@ -901,6 +901,12 @@
                                                month -= 12;
                                        }
                                }
+                               int daysInMonth = daysForEachMonth[month - 1];
+                               if (day > daysInMonth)
+                               {
+                                       day = daysInMonth;
+                               }
+
                                return new DateTime(year, month, day,
                                                                        hour, 
minute, second, fractions);
                        }


_______________________________________________
dotgnu-pnet-commits mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/dotgnu-pnet-commits

Reply via email to