Skip to content

Revised calendar classes for Reiwa era #2224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 4, 2019
Merged

Conversation

rpetrusha
Copy link

Revised calendar classes for Reiwa era

Fixes dotnet/docs#11610

@tarekgh

@rpetrusha rpetrusha added this to the April 2019 milestone Apr 1, 2019
@rpetrusha rpetrusha self-assigned this Apr 1, 2019
@@ -1,4 +1,3 @@

> [!IMPORTANT]
> A new era in the <xref:System.Globalization.JapaneseCalendar> and <xref:System.Globalization.JapaneseLunisolarCalendar> begins on May 1, 2019. This change affects all applications that use these calendars. See [Handling a new era in the Japanese calendar in .NET](https://devblogs.microsoft.com/dotnet/handling-a-new-era-in-the-japanese-calendar-in-net/) for more information and to determine whether your applications are affected. See [Prepare your application for the Japanese era change](/windows/uwp/design/globalizing/japanese-era-change) for information on testing your applications on Windows systems to ensure their readiness for the era change.

> The Reiwa era, a new era in the <xref:System.Globalization.JapaneseCalendar> and <xref:System.Globalization.JapaneseLunisolarCalendar>, begins on May 1, 2019. This change affects all applications that use these calendars. See [Handling a new era in the Japanese calendar in .NET](https://devblogs.microsoft.com/dotnet/handling-a-new-era-in-the-japanese-calendar-in-net/) for more information and to determine whether your applications are affected. See [Prepare your application for the Japanese era change](/windows/uwp/design/globalizing/japanese-era-change) for information on testing your applications on Windows systems to ensure their readiness for the era change. See [Working with eras](~/docs/standard/datetime/working-with-calendars.md#working-with-eras) for features in .NET that support calendard with multiple eras and for best practices when working with calendars that support multiple eras.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Reiwa era, a new era in the [](start = 3, length = 31)

I would rephrase this part with something like:

Japanese calendars expected to new era every while. For example, on May 1, 2019 introduced a new era Reiwa.

then you can continue what you have wrote

This change affects all applications that use these calendars....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to mention this will make us not changing this doc again (I guess)


In reply to: 271383644 [](ancestors = 271383644)

@@ -1059,6 +1059,8 @@

[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)]

Of the calendar implementations in .NET, only the <xref:System.Globalization.JapaneseCalendar> and <xref:System.Globalization.JapaneseLunisolarCalendar> classes support multiple eras.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only the [](start = 41, length = 9)

I would avoid telling "only" just in case in the future we can have more calendars have multiple eras. nobody knows :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if new calendar with multiple eras are added, I guess you'd have to rewrite this anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really, the new calendars may not have anything related to Japanese calendars.


The Japanese calendar recognizes one era for every emperor's reign. The current era is the Heisei era, which began in the Gregorian calendar year 1989. The era name is typically displayed before the year. For example, the Gregorian calendar year 2001 is the Japanese calendar year Heisei 13. Note that the first year of an era is called "Gannen." Therefore, the Gregorian calendar year 1989 was the Japanese calendar year Heisei Gannen. By default, formatting operations with specified date and time format strings, such as "D", "F", and "Y", output Gannen rather than "1" in the result string.
The Japanese calendar recognizes one era for every emperor's reign. The two most recent eras are the Heisei era, beginning in the Gregorian calendar year 1989, and the Reiwa era, beginning in the Gregorian calendar year 2019. The era name is typically displayed before the year. For example, the Gregorian calendar year 2001 is the Japanese calendar year Heisei 13. Note that the first year of an era is called "Gannen." Therefore, the Gregorian calendar year 1989 was the Japanese calendar year Heisei Gannen. By default, formatting operations with specified date and time format strings, such as "D", "F", and "Y", output Gannen rather than "1" in the result string.

[!INCLUDE[japanese-era-note](~/includes/calendar-era.md)]

This class assigns numbers to the eras as follows:

|GetEra value|Era Name|Era Abbreviation|Gregorian Dates|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetEra [](start = 1, length = 6)

This is a good doc we can reference in other related docs to mention the supported Japanese eras. so this doc would be the only doc we can touch in the future when getting the new era.


For example, the <xref:System.Globalization.EastAsianLunisolarCalendar.GetMonth%2A> method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the <xref:System.Globalization.EastAsianLunisolarCalendar.GetMonth%2A> method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month.

The `JapaneseLuniSolarCalendar` class recognizes one era for every emperor's reign. The current era is the Heisei era, which began in the Gregorian calendar year 1989. The era name is typically displayed before the year. For example, the Gregorian calendar year 2001 is the Japanese calendar year Heisei 13. Note that the first year of an era is called "Gannen." Therefore, the Gregorian calendar year 1989 was the Japanese calendar year Heisei Gannen.
The `JapaneseLuniSolarCalendar` class recognizes one era for every emperor's reign. The two most recent eras are the Heisei era, beginning in the Gregorian calendar year 1989, and the Reiwa era, beginning in the Gregorian calendar year 2019. The era name is typically displayed before the year. For example, the Gregorian calendar year 2001 is the Japanese calendar year Heisei 13. Note that the first year of an era is called "Gannen." Therefore, the Gregorian calendar year 1989 was the Japanese calendar year Heisei Gannen.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two most recent eras are [](start = 88, length = 24)

this my be a little bit confusing as people may understand the calendar support only these 2 eras.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe if he adds For example before the sentence starts?

@tarekgh
Copy link
Member

tarekgh commented Apr 2, 2019

|1|明治 (Meiji)|明 (M, m)|September 8, 1868 to July 29, 1912|

I believe the luni-solar calendar not supporting the early eras (e.g. era 1 and 2)


Refers to: xml/System.Globalization/JapaneseLunisolarCalendar.xml:63 in b83e4a1. [](commit_id = b83e4a1, deletion_comment = False)

Copy link
Contributor

@mairaw mairaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but left a few comments for you to consider and @tarekgh as well

@@ -415,7 +417,7 @@
This class handles dates from September 8 in the year Meiji 1 (January 1, 1868 of the Gregorian calendar). Although the Japanese calendar was switched from a lunar calendar to a solar calendar in the year Meiji 6 (1873 of the Gregorian calendar), this implementation is based on the solar calendar only.

> [!NOTE]
> Should additional eras be added in the future, applications may encounter more than the expected four eras for the Japanese calendar. Applications should be tested to ensure that they continue to work in such an event; see [Era Handling for the Japanese Calendar](https://go.microsoft.com/fwlink/p/?LinkId=239618).
> Should additional eras be added in the future, applications may encounter more than the expected five eras for the Japanese calendar. Your applications should be tested to ensure that they continue to work in such an event; see [Era Handling for the Japanese Calendar](https://go.microsoft.com/fwlink/p/?LinkId=239618).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> Should additional eras be added in the future, applications may encounter more than the expected five eras for the Japanese calendar. Your applications should be tested to ensure that they continue to work in such an event; see [Era Handling for the Japanese Calendar](https://go.microsoft.com/fwlink/p/?LinkId=239618).
> Should additional eras be added in the future, applications may encounter more than the expected five eras for the Japanese calendar. Your applications should be tested to ensure that they continue to work in such an event; see [Era Handling for the Japanese Calendar](/windows/desktop/Intl/era-handling-for-the-japanese-calendar).

@@ -44,18 +44,19 @@
The <xref:System.Globalization.JapaneseLunisolarCalendar> class is derived from the <xref:System.Globalization.EastAsianLunisolarCalendar> class, which represents the lunisolar calendar. The <xref:System.Globalization.EastAsianLunisolarCalendar> class supports the sexagenary year cycle (which repeats every 60 years) in addition to solar years and lunar months. Each solar year in the calendar is associated with a Sexagenary Year, a Celestial Stem, and a Terrestrial Branch, and these calendars can have leap months after any month of the year.

> [!NOTE]
> For information about using the <xref:System.Globalization.JapaneseLunisolarCalendar> class and the other calendar classes in the .NET Framework, see [Working with Calendars](~/docs/standard/datetime/working-with-calendars.md).
> For information about using the <xref:System.Globalization.JapaneseLunisolarCalendar> class and the other calendar classes in the .NET Class Library, see [Working with Calendars](~/docs/standard/datetime/working-with-calendars.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> For information about using the <xref:System.Globalization.JapaneseLunisolarCalendar> class and the other calendar classes in the .NET Class Library, see [Working with Calendars](~/docs/standard/datetime/working-with-calendars.md).
> For information about using the <xref:System.Globalization.JapaneseLunisolarCalendar> class and the other calendar classes in .NET, see [Working with Calendars](~/docs/standard/datetime/working-with-calendars.md).


For example, the <xref:System.Globalization.EastAsianLunisolarCalendar.GetMonth%2A> method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the <xref:System.Globalization.EastAsianLunisolarCalendar.GetMonth%2A> method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month.

The `JapaneseLuniSolarCalendar` class recognizes one era for every emperor's reign. The current era is the Heisei era, which began in the Gregorian calendar year 1989. The era name is typically displayed before the year. For example, the Gregorian calendar year 2001 is the Japanese calendar year Heisei 13. Note that the first year of an era is called "Gannen." Therefore, the Gregorian calendar year 1989 was the Japanese calendar year Heisei Gannen.
The `JapaneseLuniSolarCalendar` class recognizes one era for every emperor's reign. The two most recent eras are the Heisei era, beginning in the Gregorian calendar year 1989, and the Reiwa era, beginning in the Gregorian calendar year 2019. The era name is typically displayed before the year. For example, the Gregorian calendar year 2001 is the Japanese calendar year Heisei 13. Note that the first year of an era is called "Gannen." Therefore, the Gregorian calendar year 1989 was the Japanese calendar year Heisei Gannen.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe if he adds For example before the sentence starts?

@rpetrusha rpetrusha merged commit 974192e into dotnet:master Apr 4, 2019
@rpetrusha rpetrusha deleted the reiwa-era branch April 4, 2019 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants