elapsed_days() public static method

The method is a helper function.
public static elapsed_days ( int year ) : int
year int An integer specifying the Hebrew year. ///
return int
コード例 #1
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);
        }
コード例 #2
0
        public static int new_year_delay(int year)
        {
            int num  = CCHebrewCalendar.elapsed_days(year);
            int num2 = CCHebrewCalendar.elapsed_days(year + 1);

            if (num2 - num == 356)
            {
                return(2);
            }
            int num3 = CCHebrewCalendar.elapsed_days(year - 1);

            if (num - num3 == 382)
            {
                return(1);
            }
            return(0);
        }