/// <summary>Calculates a date that is a specified number of months away from a specified initial date.</summary> /// <param name="time">The date to which to add months. The <see cref="T:System.Globalization.UmAlQuraCalendar" /> class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date).</param> /// <param name="months">The positive or negative number of months to add. </param> /// <returns>The date yielded by adding the number of months specified by the <paramref name="months" /> parameter to the date specified by the <paramref name="time" /> parameter.</returns> /// <exception cref="T:System.ArgumentException">The resulting date is outside the range supported by the <see cref="T:System.Globalization.UmAlQuraCalendar" /> class. </exception> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// <paramref name="months" /> is less than -120,000 or greater than 120,000. -or- /// <paramref name="time" /> is outside the range supported by this calendar.</exception> // Token: 0x06002ED8 RID: 11992 RVA: 0x000B3E20 File Offset: 0x000B2020 public override DateTime AddMonths(DateTime time, int months) { if (months < -120000 || months > 120000) { throw new ArgumentOutOfRangeException("months", string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("ArgumentOutOfRange_Range"), -120000, 120000)); } int num = this.GetDatePart(time, 0); int num2 = this.GetDatePart(time, 2); int num3 = this.GetDatePart(time, 3); int num4 = num2 - 1 + months; if (num4 >= 0) { num2 = num4 % 12 + 1; num += num4 / 12; } else { num2 = 12 + (num4 + 1) % 12; num += (num4 - 11) / 12; } if (num3 > 29) { int daysInMonth = this.GetDaysInMonth(num, num2); if (num3 > daysInMonth) { num3 = daysInMonth; } } UmAlQuraCalendar.CheckYearRange(num, 1); DateTime result = new DateTime(UmAlQuraCalendar.GetAbsoluteDateUmAlQura(num, num2, num3) * 864000000000L + time.Ticks % 864000000000L); Calendar.CheckAddResult(result.Ticks, this.MinSupportedDateTime, this.MaxSupportedDateTime); return(result); }
// Token: 0x06002ED5 RID: 11989 RVA: 0x000B3C9E File Offset: 0x000B1E9E internal static void CheckYearMonthRange(int year, int month, int era) { UmAlQuraCalendar.CheckYearRange(year, era); if (month < 1 || month > 12) { throw new ArgumentOutOfRangeException("month", Environment.GetResourceString("ArgumentOutOfRange_Month")); } }
/// <summary>Determines whether the specified year in the specified era is a leap year.</summary> /// <param name="year">A year. </param> /// <param name="era">An era. Specify <see langword="UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" />.</param> /// <returns> /// <see langword="true" /> if the specified year is a leap year; otherwise, <see langword="false" />.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// <paramref name="year" /> or <paramref name="era" /> is outside the range supported by the <see cref="T:System.Globalization.UmAlQuraCalendar" /> class. </exception> // Token: 0x06002EE8 RID: 12008 RVA: 0x000B4089 File Offset: 0x000B2289 public override bool IsLeapYear(int year, int era) { UmAlQuraCalendar.CheckYearRange(year, era); return(UmAlQuraCalendar.RealGetDaysInYear(year) == 355); }
/// <summary>Calculates the leap month for a specified year and era.</summary> /// <param name="year">A year.</param> /// <param name="era">An era. Specify <see langword="UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" />.</param> /// <returns>Always 0 because the <see cref="T:System.Globalization.UmAlQuraCalendar" /> class does not support leap months.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// <paramref name="year" /> is less than 1318 or greater than 1450.-or- /// <paramref name="era" /> is not <see langword="UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" />.</exception> // Token: 0x06002EE6 RID: 12006 RVA: 0x000B4074 File Offset: 0x000B2274 public override int GetLeapMonth(int year, int era) { UmAlQuraCalendar.CheckYearRange(year, era); return(0); }
/// <summary>Calculates the number of months in the specified year of the specified era.</summary> /// <param name="year">A year. </param> /// <param name="era">An era. Specify <see langword="UmAlQuaraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" />.</param> /// <returns>Always 12.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// <paramref name="year" /> is outside the range supported by this calendar. </exception> /// <exception cref="T:System.ArgumentException"> /// <paramref name="era" /> is outside the range supported by this calendar. </exception> // Token: 0x06002EE3 RID: 12003 RVA: 0x000B3FFD File Offset: 0x000B21FD public override int GetMonthsInYear(int year, int era) { UmAlQuraCalendar.CheckYearRange(year, era); return(12); }
/// <summary>Calculates the number of days in the specified year of the specified era.</summary> /// <param name="year">A year. </param> /// <param name="era">An era. Specify <see langword="UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra]" /> or <see cref="F:System.Globalization.UmAlQuraCalendar.UmAlQuraEra" />.</param> /// <returns>The number of days in the specified year and era. The number of days is 354 in a common year or 355 in a leap year.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// <paramref name="year" /> or <paramref name="era" /> is outside the range supported by the <see cref="T:System.Globalization.UmAlQuraCalendar" /> class. </exception> // Token: 0x06002EDF RID: 11999 RVA: 0x000B3FC9 File Offset: 0x000B21C9 public override int GetDaysInYear(int year, int era) { UmAlQuraCalendar.CheckYearRange(year, era); return(UmAlQuraCalendar.RealGetDaysInYear(year)); }