System.Globalization.CCHebrewCalendar.last_day_of_month C# (CSharp) Method

last_day_of_month() public static method

The method computes the last day of month (nummer of days in a month) of the given Hebrew year.
/// The exception is thrown if month not between One and Thirteen. ///
public static last_day_of_month ( int month, int year ) : int
month int The Hebrew month, allowed value between /// One and Thirteen. ///
year int An integer that gives the Hebrew year. ///
return int
	public static int last_day_of_month(int month, int year) {
		if (month < 1 || month > 13)
			throw new System.ArgumentOutOfRangeException("month",
				"Month should be between One and Thirteen.");
		switch (month) {
			case 2: return 29;
			case 4: return 29;
			case 6: return 29;
			case 8:
				if (!long_heshvan(year))
					return 29;
				break;
			case 9:
				if (short_kislev(year))
					return 29;
				break;
			case 10: return 29;
			case 12:
				if (!is_leap_year(year))
					return 29;
				break;
			case 13: return 29;
		}
		return 30;
	}
	

Usage Example

Beispiel #1
0
        /// <summary>
        /// Overridden. Gives the number of days in the specified month
        /// of the given year and era.
        /// </summary>
        /// <param name="year">An integer that gives the year.
        /// </param>
        /// <param name="month">An integer that gives the month, starting
        /// with 1.</param>
        /// <param name="era">An integer that gives the era of the specified
        /// year.</param>
        /// <returns>An integer that gives the number of days of the
        /// specified month.</returns>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        /// The exception is thrown, if <paramref name="month"/>,
        /// <paramref name="year"/> ,or <paramref name="era"/> is outside
        /// the allowed range.
        /// </exception>
        public override int GetDaysInMonth(int year, int month, int era)
        {
            M_CheckYME(year, month, ref era);
            int ccmonth = M_CCMonth(month, year);

            return(CCHebrewCalendar.last_day_of_month(ccmonth, year));
        }
All Usage Examples Of System.Globalization.CCHebrewCalendar::last_day_of_month