public static IsLeapYear ( this year, CalendarType calendarType = CalendarType.PersianCalendar ) : bool | ||
year | this | |
calendarType | CalendarType | |
return | bool |
public static bool IsLeapYear(this int year, CalendarType calendarType = CalendarType.PersianCalendar)
{
if (calendarType == CalendarType.GregorianCalendar)
return DateTime.IsLeapYear(year);
var r = year % 33;
return (r == 1 || r == 5 || r == 9 || r == 13 || r == 17 || r == 22 || r == 26 || r == 30);
}