Author: atsushi
Date: 2006-03-20 20:49:24 -0500 (Mon, 20 Mar 2006)
New Revision: 58211

Modified:
   trunk/mcs/class/corlib/System.Globalization/ChangeLog
   trunk/mcs/class/corlib/System.Globalization/HebrewCalendar.cs
   trunk/mcs/class/corlib/Test/System.Globalization/CalendarTest.cs
   trunk/mcs/class/corlib/Test/System.Globalization/ChangeLog
Log:
2006-03-21  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * HebrewCalrndar.cs : simply use CCHebrewCalendar.last_day_of_month().
          Patch by Yaacov Akiba Slama. Fixed bug #76252.

        * CalendarTest.cs : added test for bug #76252.



Modified: trunk/mcs/class/corlib/System.Globalization/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Globalization/ChangeLog       2006-03-21 
01:28:32 UTC (rev 58210)
+++ trunk/mcs/class/corlib/System.Globalization/ChangeLog       2006-03-21 
01:49:24 UTC (rev 58211)
@@ -1,3 +1,8 @@
+2006-03-21  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * HebrewCalrndar.cs : simply use CCHebrewCalendar.last_day_of_month().
+         Patch by Yaacov Akiba Slama. Fixed bug #76252.
+
 2006-03-20  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * HebrewCalrndar.cs : removed commented obsolete code.

Modified: trunk/mcs/class/corlib/System.Globalization/HebrewCalendar.cs
===================================================================
--- trunk/mcs/class/corlib/System.Globalization/HebrewCalendar.cs       
2006-03-21 01:28:32 UTC (rev 58210)
+++ trunk/mcs/class/corlib/System.Globalization/HebrewCalendar.cs       
2006-03-21 01:49:24 UTC (rev 58211)
@@ -389,7 +389,7 @@
        /// <remarks>
        /// <para>
        /// In .NET the month counting starts with the Hebrew month Tishri.
-       /// Calendrical Calculations starts with the month Tisan. So we must
+       /// Calendrical Calculations starts with the month Nisan. So we must
        /// map here.
        /// </para>
        /// </remarks>
@@ -456,9 +456,7 @@
        public override int GetDaysInMonth(int year, int month, int era) {
                M_CheckYME(year, month, ref era);
                int ccmonth = M_CCMonth(month, year); 
-               int rd1 = CCHebrewCalendar.fixed_from_dmy(1, ccmonth, year);
-               int rd2 = CCHebrewCalendar.fixed_from_dmy(1, ccmonth+1, year);
-               return rd2 - rd1;
+               return CCHebrewCalendar.last_day_of_month(ccmonth, year);
        }
 
        /// <summary>

Modified: trunk/mcs/class/corlib/Test/System.Globalization/CalendarTest.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System.Globalization/CalendarTest.cs    
2006-03-21 01:28:32 UTC (rev 58210)
+++ trunk/mcs/class/corlib/Test/System.Globalization/CalendarTest.cs    
2006-03-21 01:49:24 UTC (rev 58211)
@@ -530,6 +530,16 @@
                }
        }
 
+       [Test] // wrt bug #76252.
+       public void HebrewCalendarGetDaysInMonth ()
+       {
+               HebrewCalendar c = new HebrewCalendar ();
+               int year = c.GetYear (new DateTime (2005, 9, 1));
+               AssertEquals (5765, year);
+               int days = c.GetDaysInMonth (year, 13, 1);
+               AssertEquals (29, days);
+       }
+
        /* UK TODO: breaks with current DateTime implementation.
         * I've a newer one that works, but that requires to much changes.
         * for now.

Modified: trunk/mcs/class/corlib/Test/System.Globalization/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System.Globalization/ChangeLog  2006-03-21 
01:28:32 UTC (rev 58210)
+++ trunk/mcs/class/corlib/Test/System.Globalization/ChangeLog  2006-03-21 
01:49:24 UTC (rev 58211)
@@ -1,3 +1,7 @@
+2006-03-21  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * CalendarTest.cs : added test for bug #76252.
+
 2006-01-25  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * CultureInfoTest.cs : added test for bug #77347.

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

Reply via email to