Skip to content

Expand fix for ja era to handle months and days#481

Merged
EriWong merged 1 commit intomicrosoft:masterfrom
EriWong:eriwong/471month
Apr 30, 2019
Merged

Expand fix for ja era to handle months and days#481
EriWong merged 1 commit intomicrosoft:masterfrom
EriWong:eriwong/471month

Conversation

@EriWong
Copy link
Copy Markdown
Contributor

@EriWong EriWong commented Apr 29, 2019

Fixes #471

The previous fix only covered how the Calendar control handles years across era boundaries. It turns out the calendar treats the boundary as a month boundary as well. So if the transition across eras happens on the 15th of January, then it considers the 16th of January and the 14th of January to be in different months.

Description of the changes:

  • Uses the Gregorian calendar for all addition and subtraction of dates when in the Japanese era system.

How changes were validated:

  • Manually tested month and day subtraction across era boundaries not at the beginning or end of a month.

@EriWong EriWong force-pushed the eriwong/471month branch 2 times, most recently from 1d0cf42 to a268148 Compare April 30, 2019 01:27
@HowardWolosky HowardWolosky changed the title fixes #471 Expand fix for ja era to handle months and days Apr 30, 2019
@sanderl
Copy link
Copy Markdown
Contributor

sanderl commented Apr 30, 2019

        break;

Can you check if months is also affected here?


Refers to: src/CalcViewModel/Common/DateCalculator.cpp:329 in a268148. [](commit_id = a268148, deletion_comment = False)

@EriWong EriWong force-pushed the eriwong/471month branch 2 times, most recently from a1896ce to 8536d6b Compare April 30, 2019 17:30
@EriWong
Copy link
Copy Markdown
Contributor Author

EriWong commented Apr 30, 2019

        break;

Can you check if months is also affected here?

Refers to: src/CalcViewModel/Common/DateCalculator.cpp:329 in a268148. [](commit_id = a268148, deletion_comment = False)

Good catch. Latest update fixes and tests that as well. Thanks!

Expand fix for ja era to handle months and days
@EriWong EriWong merged commit 32aaa0d into microsoft:master Apr 30, 2019
EriWong added a commit to EriWong/calculator that referenced this pull request Jun 5, 2019
Expand fix for ja era to handle months and days
@EriWong EriWong deleted the eriwong/471month branch November 17, 2019 02:36
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.

Subtracting 1-year from date during Reiwa 1 yields unexpected results.

2 participants