This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Repository navigation
Fix calculating the calendar year in JapaneseLunisolarCalendar - #3662
Merged
Merged
Conversation
Member
Author
|
@AlexGhiondea could you please help code review this one? thanks. |
Member
|
Does src/mscorlib/corefx/System/Globalization/GregorianCalendarHelper.cs need to be updated as well? |
Member
Author
|
@stephentoub yes. I'll update it. thanks for the catch |
The months in this calendar is lunar months. We can have the case when a new era starts in the middle of a month which means part of the month will belong to one era and the rest will belong to the new era. When calculating the calendar year number for dates which in the rest of the month and exist in the new started era, we should still use the old era info instead of the new era info because the rest of the month still belong to the year of last era. Example of such date is Feb 2nd 1989. Using such date while the era starts on Jan 8th 1989 make this date belong to that new era which it is part of the month started with previous era. Using the new era info will have the year we are calculating equal to the era offset (i.e. year = m_EraInfo[i].yearOffset) and we’ll end returning zero for the year. The fix is to use the previous era info to calculate the year issue https://github.com/dotnet/corefx/issues/6775
tarekgh
force-pushed
the
FixGetYearForJapaneseCalendar
branch
from
March 11, 2016 19:07
b3610be to
e1fb273
Compare
Member
Author
|
Test Ubuntu x64 Checked Build and Test please |
Member
Author
|
test OSX x64 Checked Build and Test please |
Member
Author
|
@dotnet-bot could you check this one please? |
Member
|
Could you please port the fix to CoreRT as well? |
Member
Author
|
test Ubuntu x64 Checked Build and Test please |
Member
Author
|
@jkotas yes I am going to port the fix corert/PN and also I am going to track the fix for the future desktop release |
tarekgh
added a commit
that referenced
this pull request
Mar 13, 2016
Fix calculating the calendar year in JapaneseLunisolarCalendar
tarekgh
added a commit
to tarekgh/corert
that referenced
this pull request
Mar 14, 2016
This is porting the fix done in dotnet/coreclr#3662
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
…neseCalendar Fix calculating the calendar year in JapaneseLunisolarCalendar Commit migrated from dotnet/coreclr@ca9f7d7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The months in this calendar is lunar months. We can have the case when a new era
starts in the middle of a month which means part of the month will belong to one
era and the rest will belong to the new era. When calculating the calendar year
number for dates which in the rest of the month and exist in the new started era,
we should still use the old era info instead of the new era info because
the rest of the month still belong to the year of last era.
Example of such date is Feb 2nd 1989. Using such date while the era starts
on Jan 8th 1989 make this date belong to that new era which it is part of
the month started with previous era. Using the new era info will have the year
we are calculating equal to the era offset (i.e. year = m_EraInfo[i].yearOffset)
and we’ll end returning zero for the year. The fix is to use the previous era
info to calculate the year
issue https://github.com/dotnet/corefx/issues/6775