-// HebrewCalendar.cs
+// System.Globalization.HebrewCalendar.cs
//
// (C) Ulrich Kunitz 2002
//
using System;
using System.IO;
+using System.Runtime.InteropServices;
/// <summary>
/// This is the Hebrew calendar.
/// </para>
/// </remarks>
[Serializable]
-[MonoTODO ("Fix serialization compatibility with MS.NET")]
+[MonoLimitation ("Serialization format not compatible with.NET")]
public class HebrewCalendar : Calendar {
/// <summary>
/// Constructor.
public HebrewCalendar() {
M_AbbrEraNames = new string[] {"A.M."};
M_EraNames = new string[] {"Anno Mundi"};
- if (M_TwoDigitYearMax == 99)
- M_TwoDigitYearMax = 5790;
+ if (twoDigitYearMax == 99)
+ twoDigitYearMax = 5790;
}
/// <summary>
}
}
- int twoDigitYearMax = 5790;
-
public override int TwoDigitYearMax
{
get {
return HebrewEra;
}
+ public override int GetLeapMonth (int year, int era)
+ {
+ return IsLeapMonth (year, 7, era) ? 7 : 0;
+ }
+
/// <summary>
/// Overridden. Gives the number of the month of the specified
/// date.
/// is out of range.
/// </exception>
public override DateTime ToDateTime(int year, int month, int day,
- int hour, int minute, int second, int milliseconds,
+ int hour, int minute, int second, int millisecond,
int era)
{
M_CheckYMDE(year, month, day, ref era);
- M_CheckHMSM(hour, minute, second, milliseconds);
+ M_CheckHMSM(hour, minute, second, millisecond);
int ccm = M_CCMonth(month, year);
int rd = CCHebrewCalendar.fixed_from_dmy(day, ccm, year);
return CCFixed.ToDateTime(rd,
- hour, minute, second, milliseconds);
+ hour, minute, second, millisecond);
}
public override int ToFourDigitYear (int year)
{
- M_ArgumentInRange ("year", year, 0, 99);
+ M_ArgumentInRange ("year", year, 0, M_MaxYear - 1);
int baseExtra = this.twoDigitYearMax % 100;
int baseCentury = this.twoDigitYearMax - baseExtra;
+ if (year >= 100)
+ return year;
if (year <= baseExtra)
return baseCentury + year;
else
return baseCentury + year - 100;
}
-#if NET_2_0
+#if !NET_2_1
public override CalendarAlgorithmType AlgorithmType {
get {
return CalendarAlgorithmType.LunisolarCalendar;
}
}
+#endif
static DateTime Min = new DateTime (1583, 1, 1, 0, 0, 0);
static DateTime Max = new DateTime (2239, 9, 29, 11, 59, 59);
return Max;
}
}
-#endif
-
} // class HebrewCalendar
} // namespace System.Globalization