/// <summary> /// Overridden. Gives the number of days of the specified /// year of the given era. /// </summary> /// <param name="year">An integer that specifies the year. /// </param> /// <param name="era">An ineger that specifies the era. /// </param> /// <returns>An integer that gives the number of days of the /// specified year.</returns> /// <exception cref="T:System.ArgumentOutOfRangeExceiption"> /// The exception is thrown, if /// <paramref name="year"/> is outside the allowed range. /// </exception> public override int GetDaysInYear(int year, int era) { M_CheckYE(year, ref era); return(CCGregorianCalendar.GetDaysInYear(year)); }
/// <summary> /// Overridden. Adds years to a given date. /// </summary> /// <param name="time">The /// <see cref="T:System.DateTime"/> to which to add /// years. /// </param> /// <param name="years">The number of years to add.</param> /// <returns>A new <see cref="T:System.DateTime"/> value, that /// results from adding <paramref name="years"/> to the specified /// DateTime.</returns> public override DateTime AddYears(DateTime time, int years) { return(CCGregorianCalendar.AddYears(time, years)); }
/// <summary> /// Overridden. Tells whether the given day /// is a leap day. /// </summary> /// <param name="year">An integer that specifies the year in the /// given era. /// </param> /// <param name="month">An integer that specifies the month. /// </param> /// <param name="day">An integer that specifies the day. /// </param> /// <param name="era">An integer that specifies the era. /// </param> /// <returns>A boolean that tells whether the given day is a leap /// day. /// </returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// The exception is thrown, if the year, month, day, or era is not /// valid. /// </exception> public override bool IsLeapDay(int year, int month, int day, int era) { int gregorianYear = M_CheckYMDEG(year, month, day, ref era); return CCGregorianCalendar.IsLeapDay(gregorianYear, month, day); }
/// <summary> /// Static constructor, who creates and initializes /// <see cref="F:M_EraHandler"/>. /// </summary> static TaiwanCalendar() { M_EraHandler = new CCGregorianEraHandler(); M_EraHandler.appendEra(1, CCGregorianCalendar.fixed_from_dmy(1, 1, 1912)); }
/// <summary> /// Overridden. Adds years to a given date. /// </summary> /// <param name="time">The /// <see cref="T:System.DateTime"/> to which to add /// years. /// </param> /// <param name="years">The number of years to add.</param> /// <returns>A new <see cref="T:System.DateTime"/> value, that /// results from adding <paramref name="years"/> to the specified /// DateTime.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// The exception is thrown if /// <see cref="T:System.DateTime"/> return value is outside all /// supported eras. /// </exception> public override DateTime AddYears(DateTime time, int years) { DateTime t = CCGregorianCalendar.AddYears(time, years); M_CheckDateTime(t); return t; }
/// <summary> /// Overridden. Gives the number of days in the specified month /// of the given year and era. /// </summary> /// <param name="year">An integer that gives the year. /// </param> /// <param name="month">An integer that gives the month, starting /// with 1.</param> /// <param name="era">An integer that gives the era of the specified /// year.</param> /// <returns>An integer that gives the number of days of the /// specified month.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// The exception is thrown, if <paramref name="month"/>, /// <paramref name="year"/> ,or <paramref name="era"/> is outside /// the allowed range. /// </exception> public override int GetDaysInMonth(int year, int month, int era) { int gregorianYear = M_CheckYMEG(year, month, ref era); return CCGregorianCalendar.GetDaysInMonth(gregorianYear, month); }
public static int GetYear(DateTime time) { return(CCGregorianCalendar.year_from_fixed(CCFixed.FromDateTime(time))); }
/// <summary> /// Static constructor, who creates and initializes /// <see cref="F:M_EraHandler"/>. /// </summary> static ThaiBuddhistCalendar() { M_EraHandler = new CCGregorianEraHandler(); M_EraHandler.appendEra(ThaiBuddhistEra, CCGregorianCalendar.fixed_from_dmy(1, 1, -542)); }
public static int days_remaining(int day, int month, int year) { return(CCGregorianCalendar.date_difference(day, month, year, 31, 12, year)); }
public static int GetMonth(DateTime time) { return(CCGregorianCalendar.month_from_fixed(CCFixed.FromDateTime(time))); }
/// <summary> /// Static constructor, who creates and initializes /// <see cref="F:M_EraHandler"/>. /// </summary> static KoreanCalendar() { M_EraHandler = new CCGregorianEraHandler(); M_EraHandler.appendEra(KoreanEra, CCGregorianCalendar.fixed_from_dmy(1, 1, -2332)); }
/// <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(CCGregorianCalendar.is_leap_year(year)); }
/// <summary> /// Overridden. Tells whether the given day /// is a leap day. /// </summary> /// <param name="year">An integer that specifies the year in the /// given era. /// </param> /// <param name="month">An integer that specifies the month. /// </param> /// <param name="day">An integer that specifies the day. /// </param> /// <param name="era">An integer that specifies the era. /// </param> /// <returns>A boolean that tells whether the given day is a leap /// day. /// </returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// The exception is thrown, if the year, month, day, or era is not /// valid. /// </exception> public override bool IsLeapDay(int year, int month, int day, int era) { M_CheckYMDE(year, month, day, ref era); return(CCGregorianCalendar.IsLeapDay(year, month, day)); }
/// <summary> /// Overridden. Gives the number of the day in the year. /// </summary> /// <param name="time">The /// <see cref="T:System.DateTime"/> that specifies a /// date. /// </param> /// <returns>An integer representing the day of the year, /// starting with 1.</returns> public override int GetDayOfYear(DateTime time) { return(CCGregorianCalendar.GetDayOfYear(time)); }
public static bool IsLeapDay(int year, int month, int day) { return(CCGregorianCalendar.is_leap_year(year) && month == 2 && day == 29); }
/// <summary> /// Overridden. Gives the number of the month of the specified /// date. /// </summary> /// <param name="time">The /// <see cref="T:System.DateTime"/> that specifies a /// date. /// </param> /// <returns>An integer representing the month, /// starting with 1.</returns> public override int GetMonth(DateTime time) { return(CCGregorianCalendar.GetMonth(time)); }
public static DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int milliseconds) { return(CCFixed.ToDateTime(CCGregorianCalendar.fixed_from_dmy(day, month, year), hour, minute, second, (double)milliseconds)); }
/// <summary> /// Overrideden. Adds months to a given date. /// </summary> /// <param name="time">The /// <see cref="T:System.DateTime"/> to which to add /// months. /// </param> /// <param name="months">The number of months to add.</param> /// <returns>A new <see cref="T:System.DateTime"/> value, that /// results from adding <paramref name="months"/> to the specified /// DateTime.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// The exception is thrown if /// <see cref="T:System.DateTime"/> return value is outside all /// supported eras. /// </exception> public override DateTime AddMonths(DateTime time, int months) { DateTime t = CCGregorianCalendar.AddMonths(time, months); M_CheckDateTime(t); return t; }
public static void dmy_from_fixed(out int day, out int month, out int year, int date) { CCGregorianCalendar.my_from_fixed(out month, out year, date); day = date - CCGregorianCalendar.fixed_from_dmy(1, month, year) + 1; }
/// <summary> /// Overridden. Gives the number of the day in the year. /// </summary> /// <param name="time">The /// <see cref="T:System.DateTime"/> that specifies a /// date. /// </param> /// <returns>An integer representing the day of the year, /// starting with 1.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// The exception is thrown if the /// <see cref="T:System.DateTime"/> parameter is outside all /// supported eras. /// </exception> public override int GetDayOfYear(DateTime time) { M_CheckDateTime(time); return CCGregorianCalendar.GetDayOfYear(time); }
public static int date_difference(int dayA, int monthA, int yearA, int dayB, int monthB, int yearB) { return(CCGregorianCalendar.fixed_from_dmy(dayB, monthB, yearB) - CCGregorianCalendar.fixed_from_dmy(dayA, monthA, yearA)); }
/// <summary> /// Overridden. Gives the number of days of the specified /// year of the given era. /// </summary> /// <param name="year">An integer that specifies the year. /// </param> /// <param name="era">An ineger that specifies the era. /// </param> /// <returns>An integer that gives the number of days of the /// specified year.</returns> /// <exception cref="T:System.ArgumentOutOfRangeExceiption"> /// The exception is thrown, if /// <paramref name="year"/> or <paramref name="era"/> are outside the /// allowed range. /// </exception> public override int GetDaysInYear(int year, int era) { int gregorianYear = M_CheckYEG(year, ref era); return CCGregorianCalendar.GetDaysInYear(gregorianYear); }
public static int day_number(int day, int month, int year) { return(CCGregorianCalendar.date_difference(31, 12, year - 1, day, month, year)); }
/// <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) { int gregorianYear = M_CheckYEG(year, ref era); return CCGregorianCalendar.is_leap_year(gregorianYear); }
/// <summary> /// Overrideden. Adds months to a given date. /// </summary> /// <param name="time">The /// <see cref="T:System.DateTime"/> to which to add /// months. /// </param> /// <param name="months">The number of months to add.</param> /// <returns>A new <see cref="T:System.DateTime"/> value, that /// results from adding <paramref name="months"/> to the specified /// DateTime.</returns> public override DateTime AddMonths(DateTime time, int months) { return(CCGregorianCalendar.AddMonths(time, months)); }
/// <summary> /// Overriden. Gets the day of the month from /// <paramref name="time"/>. /// </summary> /// <param name="time">The /// <see cref="T:System.DateTime"/> that specifies a /// date. /// </param> /// <returns>An integer giving the day of months, starting with 1. /// </returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// The exception is thrown if the /// <see cref="T:System.DateTime"/> parameter is outside all /// supported eras. /// </exception> public override int GetDayOfMonth(DateTime time) { M_CheckDateTime(time); return(CCGregorianCalendar.GetDayOfMonth(time)); }
/// <summary> /// Overridden. Gives the number of days in the specified month /// of the given year and era. /// </summary> /// <param name="year">An integer that gives the year. /// </param> /// <param name="month">An integer that gives the month, starting /// with 1.</param> /// <param name="era">An intger that gives the era of the specified /// year.</param> /// <returns>An integer that gives the number of days of the /// specified month.</returns> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// The exception is thrown, if <paramref name="month"/>, /// <paramref name="year"/> ,or <paramref name="era"/> is outside /// the allowed range. /// </exception> public override int GetDaysInMonth(int year, int month, int era) { // mscorlib doesn't check year, probably a bug; we do M_CheckYME(year, month, ref era); return(CCGregorianCalendar.GetDaysInMonth(year, month)); }