dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] pnetlib ./ChangeLog runtime/System/DateTime.cs


From: Heiko Weiss
Subject: [dotgnu-pnet-commits] pnetlib ./ChangeLog runtime/System/DateTime.cs
Date: Fri, 03 Feb 2006 06:28:59 +0000

CVSROOT:        /sources/dotgnu-pnet
Module name:    pnetlib
Branch:         
Changes by:     Heiko Weiss <address@hidden>    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  <address@hidden>
+
+       * runtime/System/DateTime.cs: fixed exception in AddMonths, if the new 
month has less days then the old month
+
 2006-02-01  Heiko Weiss <address@hidden>
 
        * 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);
                        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]