[Mono-bugs] [Bug 76252][Wis] New - Exception in HebrewCalendar
Class func GetDaysInMonth()
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Tue Sep 27 17:15:51 EDT 2005
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by bugs at a7n8x.net.
http://bugzilla.ximian.com/show_bug.cgi?id=76252
--- shadow/76252 2005-09-27 17:15:51.000000000 -0400
+++ shadow/76252.tmp.17947 2005-09-27 17:15:51.000000000 -0400
@@ -0,0 +1,81 @@
+Bug#: 76252
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details: FC3
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: bugs at a7n8x.net
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Exception in HebrewCalendar Class func GetDaysInMonth()
+
+The class HebrewCalendar() produces an Unhandled Exception, when exectuting
+this code:
+
+using System;
+using System.Globalization;
+
+public class SampleCalendar {
+
+ public static void Main() {
+
+ // Creates an instance for Calendar.
+ Calendar myCal = new HebrewCalendar();
+
+ // For each calendar, displays the current year, the number of months
+in that year,
+ // and the number of days in each month of that year.
+ int i, iYear, iMonth, iDay;
+ DateTime myDT = DateTime.Today;
+
+ iYear = myCal.GetYear( myDT );
+ Console.WriteLine();
+ Console.WriteLine( "{0}, Year: {1}", myCal.GetType(), myCal.GetYear(
+myDT ) );
+ Console.WriteLine( " MonthsInYear: {0}", myCal.GetMonthsInYear(
+iYear ) );
+ Console.WriteLine( " DaysInYear: {0}", myCal.GetDaysInYear( iYear ) );
+ Console.WriteLine( " Days in each month:" );
+ Console.Write( " " );
+
+ for ( i = 1; i <= myCal.GetMonthsInYear( iYear ); i++ )
+ Console.Write( " {0,-5}", myCal.GetDaysInMonth( iYear, i ) );
+ Console.WriteLine();
+
+ iMonth = myCal.GetMonth( myDT );
+ iDay = myCal.GetDayOfMonth( myDT );
+ Console.WriteLine( " IsLeapDay: {0}", myCal.IsLeapDay( iYear,
+iMonth, iDay ) );
+ Console.WriteLine( " IsLeapMonth: {0}", myCal.IsLeapMonth( iYear,
+iMonth ) );
+ Console.WriteLine( " IsLeapYear: {0}", myCal.IsLeapYear( iYear ) );
+
+ }
+
+}
+
+in month 13 produces this error:
+
+Unhandled Exception: System.ArgumentOutOfRangeException: Valid values are
+between 1 and -354, inclusive.
+Parameter name: day
+in <0x00076> System.Globalization.Calendar:M_ArgumentInRange (System.String
+param, Int32 arg, Int32 a, Int32 b)
+in <0x00050> System.Globalization.HebrewCalendar:M_CheckYMDE (Int32 year,
+Int32 month, Int32 day, System.Int32 era)
+in <0x00019> System.Globalization.HebrewCalendar:IsLeapDay (Int32 year,
+Int32 month, Int32 day, Int32 era)
+in <0x00019> System.Globalization.Calendar:IsLeapDay (Int32 year, Int32
+month, Int32 day)
+in <0x001ec> SampleCalendar:Main ()
+
+I test another Calendar classes and run ok.
+
+Using a mono 1.1.9.1 (sep 2005).
More information about the mono-bugs
mailing list