10 internal static EraInfo[] taiwanEraInfo =
new EraInfo[1]
12 new EraInfo(1, 1912, 1, 1, 1911, 1, 8088)
15 internal static volatile Calendar s_defaultInstance;
17 internal GregorianCalendarHelper helper;
19 internal static readonly
DateTime calendarMinValue =
new DateTime(1912, 1, 1);
21 private const int DEFAULT_TWO_DIGIT_YEAR_MAX = 99;
30 return calendarMinValue;
56 internal override int ID => 4;
60 public override int[]
Eras => helper.Eras;
70 if (twoDigitYearMax == -1)
72 twoDigitYearMax =
Calendar.GetSystemTwoDigitYearSetting(ID, 99);
74 return twoDigitYearMax;
79 if (value < 99 || value > helper.MaxYear)
83 twoDigitYearMax = value;
87 internal static Calendar GetDefaultInstance()
89 if (s_defaultInstance ==
null)
93 return s_defaultInstance;
108 helper =
new GregorianCalendarHelper(
this, taiwanEraInfo);
131 return helper.
AddYears(time, years);
145 return helper.GetDaysInMonth(year, month, era);
157 return helper.GetDaysInYear(year, era);
165 return helper.GetDayOfMonth(time);
173 return helper.GetDayOfWeek(time);
181 return helper.GetDayOfYear(time);
193 return helper.GetMonthsInYear(year, era);
207 return helper.GetWeekOfYear(time, rule, firstDayOfWeek);
215 return helper.GetEra(time);
223 return helper.GetMonth(time);
231 return helper.GetYear(time);
246 public override bool IsLeapDay(
int year,
int month,
int day,
int era)
248 return helper.IsLeapDay(year, month, day, era);
261 return helper.IsLeapYear(year, era);
271 return helper.GetLeapMonth(year, era);
285 return helper.IsLeapMonth(year, month, era);
307 public override DateTime ToDateTime(
int year,
int month,
int day,
int hour,
int minute,
int second,
int millisecond,
int era)
309 return helper.
ToDateTime(year, month, day, hour, minute, second, millisecond, era);
323 if (year > helper.MaxYear)
override CalendarAlgorithmType AlgorithmType
Gets a value that indicates whether the current calendar is solar-based, lunar-based,...
DateTime AddYears(int value)
Returns a new T:System.DateTime that adds the specified number of years to the value of this instance...
The exception that is thrown as a wrapper around the exception thrown by the class initializer....
Represents time in divisions, such as weeks, months, and years.
override bool IsLeapMonth(int year, int month, int era)
Determines whether the specified month in the specified year in the specified era is a leap month.
override int ToFourDigitYear(int year)
Converts the specified year to a four-digit year by using the P:System.Globalization....
override int GetWeekOfYear(DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek)
Returns the week of the year that includes the date in the specified T:System.DateTime.
override int GetMonth(DateTime time)
Returns the month in the specified T:System.DateTime.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
override bool IsLeapDay(int year, int month, int day, int era)
Determines whether the specified date in the specified era is a leap day.
TaiwanCalendar()
Initializes a new instance of the T:System.Globalization.TaiwanCalendar class.
Represents an instant in time, typically expressed as a date and time of day. To browse the ....
override int GetDayOfYear(DateTime time)
Returns the day of the year in the specified T:System.DateTime.
override bool IsLeapYear(int year, int era)
Determines whether the specified year in the specified era is a leap year.
override int GetDayOfMonth(DateTime time)
Returns the day of the month in the specified T:System.DateTime.
override int GetDaysInMonth(int year, int month, int era)
Returns the number of days in the specified month in the specified year in the specified era.
Provides information about, and means to manipulate, the current environment and platform....
DateTime AddMonths(int months)
Returns a new T:System.DateTime that adds the specified number of months to the value of this instanc...
static readonly DateTime MaxValue
Represents the largest possible value of T:System.DateTime. This field is read-only.
override int GetMonthsInYear(int year, int era)
Returns the number of months in the specified year in the specified era.
Format character that affects the layout of text or the operation of text processes,...
DateTime IConvertible. ToDateTime(IFormatProvider provider)
Returns the current T:System.DateTime object.
override DateTime MaxSupportedDateTime
Gets the latest date and time supported by the T:System.Globalization.TaiwanCalendar class.
static CultureInfo CurrentCulture
Gets or sets the T:System.Globalization.CultureInfo object that represents the culture used by the cu...
The exception that is thrown when one of the arguments provided to a method is not valid.
override DateTime MinSupportedDateTime
Gets the earliest date and time supported by the T:System.Globalization.TaiwanCalendar class.
override DateTime AddYears(DateTime time, int years)
Returns a T:System.DateTime that is the specified number of years away from the specified T:System....
override int TwoDigitYearMax
Gets or sets the last year of a 100-year range that can be represented by a 2-digit year.
CalendarWeekRule
Defines different rules for determining the first week of the year.
CalendarAlgorithmType
Specifies whether a calendar is solar-based, lunar-based, or lunisolar-based.
override int GetLeapMonth(int year, int era)
Calculates the leap month for a specified year and era.
override int GetEra(DateTime time)
Returns the era in the specified T:System.DateTime.
override DayOfWeek GetDayOfWeek(DateTime time)
Returns the day of the week in the specified T:System.DateTime.
Specifies that the class can be serialized.
override DateTime AddMonths(DateTime time, int months)
Returns a T:System.DateTime that is the specified number of months away from the specified T:System....
Provides information about a specific culture (called a locale for unmanaged code development)....
override int GetYear(DateTime time)
Returns the year in the specified T:System.DateTime.
override DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era)
Returns a T:System.DateTime that is set to the specified date and time in the specified era.
DayOfWeek
Specifies the day of the week.
override int [] Eras
Gets the list of eras in the T:System.Globalization.TaiwanCalendar.
override int GetDaysInYear(int year, int era)
Returns the number of days in the specified year in the specified era.