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
Example #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));
        }
Example #2
0
        public static int fixed_from_dmy(int day, int month, int year)
        {
            int num = -1373428;

            num += CCHebrewCalendar.elapsed_days(year);
            num += CCHebrewCalendar.new_year_delay(year);
            if (month < 7)
            {
                int num2 = CCHebrewCalendar.last_month_of_year(year);
                for (int i = 7; i <= num2; i++)
                {
                    num += CCHebrewCalendar.last_day_of_month(i, year);
                }
                for (int i = 1; i < month; i++)
                {
                    num += CCHebrewCalendar.last_day_of_month(i, year);
                }
            }
            else
            {
                for (int i = 7; i < month; i++)
                {
                    num += CCHebrewCalendar.last_day_of_month(i, year);
                }
            }
            return(num + day);
        }
Example #3
0
        public static void my_from_fixed(out int month, out int year, int date)
        {
            year = CCHebrewCalendar.year_from_fixed(date);
            int num = (date >= CCHebrewCalendar.fixed_from_dmy(1, 1, year)) ? 1 : 7;

            month = num;
            while (date > CCHebrewCalendar.fixed_from_dmy(CCHebrewCalendar.last_day_of_month(month, year), month, year))
            {
                month++;
            }
        }