Commit graph

32 commits

Author SHA1 Message Date
Frank Tang
7153a3db52 ICU-23006 Fix Chinese Calendar getActualMaximize
See #3348
2025-01-28 16:34:26 -08:00
Frank Tang
d83d26cc5d ICU-9972 Fix Chinese/Dangi Calendar getActualMaximum(UCAL_DAY_OF_YEAR)
Also fix ICU-12620 which is mark duplicate of ICU-9972 just now.
and fix ICU-22258.

Separate the new year and winter solstice cache since the calculated
value for these two calendar are mostly but not always the same due
to slightly different observation timeZone.

Remove the epochYear and zoneAstroCalc from the member data
and instead return them from a getStting() method with the two caches
since all four of them are constant per subclass of ChineseCalendar
and do not need to be different per object.

The known issues in the TestLimit is caused by both Calendar get/put the
value from the same cache while the calculated result depends on the
timeZone zoneAstroCalc.
2024-03-28 11:02:21 -07:00
Frank Tang
fbc1f33e7e ICU-22679 Clean up Calendar code.
1. Remove redudant implementation of default system ceuntry by using
   macro
2. Fold long if / else block if one block return.
2024-03-21 09:50:10 -07:00
Frank Tang
606623cf30 ICU-22679 Refactor ChineseCalendar
See #2898
2024-03-18 18:51:27 -07:00
Frank Tang
9a912bb51b ICU-22633 Add more Calendar overflow tests
Test set+set, set+add, set+roll, add+add, roll+roll
Fix more int32_t overflow problems.

Optimize both Java and C++ Hebrew Calendar month/year advancement by first consider
every 235 months is 19 years before iteration.
2024-03-13 15:48:25 -07:00
Frank Tang
d43d216feb ICU-22633 Test and fix int32_t overflow for Calendar set
Add test to set with INT32_MAX and INT32_MIN then call getTime()
and fix all the undefined errors.
2024-03-12 16:46:53 -07:00
Frank Tang
ec800e7407 ICU-22633 Return error if era is out of range 2024-02-27 10:56:28 -08:00
Frank Yung-Fong Tang
0b66fada30 ICU-22633 Fix integer overflow inside Calendar code
See #2806
2024-02-07 10:58:41 -08:00
Fredrik Roubert
c5160765d4 ICU-22639 Clone the calendar so we don't mess with the real one. 2024-01-19 08:07:22 +09:00
Frank Tang
4fcf8d22b9 ICU-22507 Fix stack overflow in ChineseCalendar::isLeapMonthBetween
Rewrite the recursive call to while loop to avoid stack overflow
when the two values have big gap.
Include tests to verify the problem in unit test.
2023-09-20 23:56:15 -07:00
Mihai Nita
00bb6789b3 ICU-22323 Remove broken link from the Chinese Calendar documentation 2023-05-03 10:51:22 -07:00
Markus Scherer
b6dcc95d3c ICU-21833 remove redundant void parameter lists
See #2351
2023-03-02 09:31:57 -08:00
Frank Tang
cd1b772cbf ICU-22027 Add C++ Calendar API for Temporal
API proposal
https://docs.google.com/document/d/1UYriEzzExiLhi2RD3zjTsI5UQHv1dXaFqrct7yXNdCA/edit#heading=h.x9obor85vpx9

Design Doc
https://docs.google.com/document/d/15ViyC9s0k3VEDwBmAkKxxz4IadZ6QrAIoETkdkF0cVA/

ICU-22027 Adjust API to remove the mention of M00L for now.
2023-01-17 15:08:08 -08:00
Frank Tang
b0ab1171ad ICU-10752 Spread (s|g)etRelativeYear to subclass
Remove the switch statment implementaiton in
Calendar::(g|s)etRelatedYear
and move the code into each subclass as proper OOP style.
2022-11-09 13:18:24 -08:00
Frank Tang
294b26eb7a ICU-22159 Merge inDaylightTime to Calendar
All the subclass implementation of inDaylightTime are the same
so just move to a base class implementation.
2022-10-31 08:42:51 -07:00
Cyndy Ishida
0dcb1cb065 ICU-22035 Remove instances of pre c++11 default constructor prevention pattern 2022-06-08 16:28:02 -07:00
Peter Varga
1986dcd0d8 ICU-21734 Add missing overrides 2021-09-07 17:42:14 -07:00
Markus Scherer
a18df7ba28 ICU-21267 stop using FALSE & TRUE macros in most library-internal headers 2020-09-10 13:55:46 -07:00
Markus Scherer
f02b496494 ICU-20783 C++ covariant return types: clone(), freeze() & friends 2019-08-22 16:24:41 -07:00
Andy Heninger
242e02c388 ICU-12764 icu4c utf-8 source files, update Copyright notices.
X-SVN-Rev: 39583
2017-01-20 00:20:31 +00:00
Michael Ow
61607c2773 ICU-12564 Update copyright notice in trunk
X-SVN-Rev: 38848
2016-06-15 18:58:17 +00:00
Yoshito Umaoka
00ca13e126 ICU-12564 Reverted r38761 and r38762, because we want to prepend the Unicode copyright for existing source files, instead of replacing copyright comments.
X-SVN-Rev: 38776
2016-05-31 21:45:07 +00:00
Michael Ow
c9f199a30f ICU-12564 Update copyright notice in ICU4C
X-SVN-Rev: 38761
2016-05-26 22:32:17 +00:00
Andy Heninger
978f71fe78 ICU-10051 Mutexes: introduce UInitOnce; remove UMTX_CHECK; replace all uses of UMTX_CHECK.
X-SVN-Rev: 33787
2013-05-31 23:50:15 +00:00
Markus Scherer
cb96abf1f8 ICU-9963 remove bogus U_I18N_API from ChineseCalendar::getStaticClassID()
X-SVN-Rev: 33283
2013-02-20 22:50:37 +00:00
Peter Edberg
47c5a5aa61 ICU-9616 Add DangiCalendar & tests, port from J to C
X-SVN-Rev: 33267
2013-02-18 23:36:57 +00:00
Peter Edberg
157ed28fc9 ICU-9616 ChineseCalendar changes to support Dangi subclass, port from J to C
X-SVN-Rev: 33265
2013-02-18 17:51:25 +00:00
George Rhoten
79a5d8c208 ICU-4081 Remove tabs
X-SVN-Rev: 23240
2008-01-16 16:45:12 +00:00
Andrew J Macheret
f018a43611 ICU-4081 Ported tests and fixed problems revealed by tests
X-SVN-Rev: 22894
2007-11-06 22:26:06 +00:00
Andrew J Macheret
4fc941c249 ICU-4081 Fixed warnings
X-SVN-Rev: 22892
2007-11-06 20:09:52 +00:00
Andrew J Macheret
f8339df718 ICU-4081 Ported Chinese calendar from icu4j. Mostly working.
X-SVN-Rev: 22853
2007-10-25 20:26:34 +00:00
Steven R. Loomis
7fb178d7d0 ICU-2424 hebrew checked in, placeholder for chinese
X-SVN-Rev: 14060
2003-12-09 20:44:56 +00:00