Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Add new era in Japan called "Reiwa"
Browse files Browse the repository at this point in the history
  • Loading branch information
acid-chicken committed Apr 1, 2019
1 parent cc23e89 commit 261ff1c
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ namespace System.Globalization
/// and the era begins on the day an emperor ascends the throne and continues until his death.
/// The era changes at 12:00AM.
///
/// For example, the current era is Heisei. It started on 1989/1/8 A.D. Therefore, Gregorian year 1989 is also Heisei 1st.
/// 1989/1/8 A.D. is also Heisei 1st 1/8.
/// For example, the current era is Reiwa. It started on 2019/5/1 A.D. Therefore, Gregorian year 2019 is also Reiwa 1st.
/// 2019/5/1 A.D. is also Reiwa 1st 5/1.
///
/// Any date in the year during which era is changed can be reckoned in either era. For example,
/// 1989/1/1 can be 1/1 Heisei 1st year or 1/1 Showa 64th year.
/// 2019/1/1 can be 1/1 Reiwa 1st year or 1/1 Heisei 31st year.
///
/// Note:
/// The DateTime can be represented by the JapaneseCalendar are limited to two factors:
Expand All @@ -30,7 +30,7 @@ namespace System.Globalization
/// Calendar Minimum Maximum
/// ========== ========== ==========
/// Gregorian 1868/09/08 9999/12/31
/// Japanese Meiji 01/01 Heisei 8011/12/31
/// Japanese Meiji 01/01 Reiwa 7981/12/31
/// </remarks>
public partial class JapaneseCalendar : Calendar
{
Expand Down Expand Up @@ -74,7 +74,8 @@ internal static EraInfo[] GetEraInfo()
// See if we have to use the built-in eras
(s_japaneseEraInfo = new EraInfo[]
{
new EraInfo(4, 1989, 1, 8, 1988, 1, GregorianCalendar.MaxYear - 1988, "\x5e73\x6210", "\x5e73", "H"),
new EraInfo(5, 2019, 5, 1, 2018, 1, GregorianCalendar.MaxYear - 2018, "\x4ee4\x548c", "\x4ee4", "R"),
new EraInfo(4, 1989, 1, 8, 1988, 1, 2019 - 1988, "\x5e73\x6210", "\x5e73", "H"),
new EraInfo(3, 1926, 12, 25, 1925, 1, 1989 - 1925, "\x662d\x548c", "\x662d", "S"),
new EraInfo(2, 1912, 7, 30, 1911, 1, 1926 - 1911, "\x5927\x6b63", "\x5927", "T"),
new EraInfo(1, 1868, 1, 1, 1867, 1, 1912 - 1867, "\x660e\x6cbb", "\x660e", "M")
Expand Down

0 comments on commit 261ff1c

Please sign in to comment.