Per Calendar::fieldDifference, 1911 to 1913 is 5879430 yrs (for roc)

Description

This is because the logic in Calendar::fieldDifference gets confused when adding positive numbers to the UCAL_YEAR field goes backward in time, which is the issue described in #9226. Either we need to fix that problem or we need to change the logic in Calendar::fieldDifference. Something similar is likely to happen with Gregorian computations across the CE/BCE boundary.

Have not tried in ICU4J, I suspect the problem is there too.

Activity

Show:
TracBot
June 30, 2018, 11:37 PM
Trac Comment 2 by —2012-03-28T19:27:10.679Z

May be addressed by changes for #9226 to make adding a positive value to year always go forwrd in time.

TracBot
June 30, 2018, 11:37 PM
Trac Comment 4 by —2012-06-20T18:11:33.197Z

This should have been fixed by #9226 so this ticket may just be for adding a test to verify that.

TracBot
June 30, 2018, 11:37 PM
Trac Comment 5 by —2012-08-28T08:19:38.639Z

And in fact all that was necessary was to just add tests to verify that the problem described here was fixed by the changes for #9226.

For C, I just added the tests to the existing tests that were created for #9243. J did not yet have the tests for #9243 (that was the subject of #9401) so I added them and then added the cross-era tests added ni C for this ticket. Note that this addresses part of #9401 (adding the tests), but these test revealed the need for code changes per #9401, so those changes were done under that ticket.

Fixed

Assignee

Peter Edberg

Reporter

Peter Edberg

Components

Labels

None

Reviewer

None

Priority

major

Time Needed

None

Fix versions