is_leap_year() public static method

The method tells whether the year is a leap year.
public static is_leap_year ( int year ) : bool
year int An integer representing the Hebrew year. ///
return bool
コード例 #1
0
        public static int last_day_of_month(int month, int year)
        {
            if (month < 1 || month > 13)
            {
                throw new 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 (!CCHebrewCalendar.long_heshvan(year))
                {
                    return(29);
                }
                break;

            case 9:
                if (CCHebrewCalendar.short_kislev(year))
                {
                    return(29);
                }
                break;

            case 10:
                return(29);

            case 12:
                if (!CCHebrewCalendar.is_leap_year(year))
                {
                    return(29);
                }
                break;

            case 13:
                return(29);
            }
            return(30);
        }
コード例 #2
0
 /// <summary>
 /// Overridden. Tells whether the given year
 /// is a leap year.
 /// </summary>
 /// <param name="year">An integer that specifies the year in the
 /// given era.
 /// </param>
 /// <param name="era">An integer that specifies the era.
 /// </param>
 /// <returns>A boolean that tells whether the given year is a leap
 /// year.
 /// </returns>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 /// The exception is thrown, if the year or era is not
 /// valid.
 /// </exception>
 public override bool IsLeapYear(int year, int era)
 {
     M_CheckYE(year, ref era);
     return(CCHebrewCalendar.is_leap_year(year));
 }
コード例 #3
0
 public static int last_month_of_year(int year)
 {
     return((!CCHebrewCalendar.is_leap_year(year)) ? 12 : 13);
 }