System.Globalization.Calendar.GetDaysInYear C# (CSharp) Method

GetDaysInYear() public method

public GetDaysInYear ( int year ) : int
year int
return int
        public virtual int GetDaysInYear(int year)
        {
            return (GetDaysInYear(year, CurrentEra));
        }

Same methods

Calendar::GetDaysInYear ( int year, int era ) : int

Usage Example

Esempio n. 1
0
        internal static int InternalGetWeekOfYearFullDays(Calendar cal, DateTime time, int firstDayOfWeek, int fullDays, int daysOfMinYearMinusOne)
        {
            int daysInYear = cal.GetDayOfYear(time) - 1;
            int num        = ((int)cal.GetDayOfWeek(time)) - (daysInYear % 7);
            int num2       = ((firstDayOfWeek - num) + 14) % 7;

            if ((num2 != 0) && (num2 >= fullDays))
            {
                num2 -= 7;
            }
            int num3 = daysInYear - num2;

            if (num3 < 0)
            {
                int year = cal.GetYear(time);
                if (year <= cal.GetYear(cal.MinSupportedDateTime))
                {
                    daysInYear = daysOfMinYearMinusOne;
                }
                else
                {
                    daysInYear = cal.GetDaysInYear(year - 1);
                }
                num -= daysInYear % 7;
                num2 = ((firstDayOfWeek - num) + 14) % 7;
                if ((num2 != 0) && (num2 >= fullDays))
                {
                    num2 -= 7;
                }
                num3 = daysInYear - num2;
            }
            return((num3 / 7) + 1);
        }
All Usage Examples Of System.Globalization.Calendar::GetDaysInYear