Commit 36c370c
authored
Polyfill: fix Chinese/Dangi calendar at extreme date ranges (#3277)
* Polyfill: fix Chinese/Dangi calendar at extreme date ranges
Use Metonic cycle (19-year) offset to shift extreme ISO years into
ICU4C's safe range before calling Intl.DateTimeFormat, then adjust
the calendar year back. Fixes #3081.
* Add runtime detection of ICU-23286 bug in Chinese/Dangi calendar
* Add chinese and dangi to thorough calendar day math tests
* Polyfill: make chineseMetonicOffset a method on helperChinese
Move the standalone chineseMetonicOffset function into helperChinese as
a metonicOffset method, using `this` instead of the `helper` parameter.
helperDangi inherits it via ObjectAssign spread.
Thanks to ptomato for the suggestion.1 parent 86a7b46 commit 36c370c
4 files changed
Lines changed: 52 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
1913 | 1914 | | |
1914 | 1915 | | |
1915 | 1916 | | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
1916 | 1923 | | |
1917 | 1924 | | |
1918 | 1925 | | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
1919 | 1962 | | |
1920 | 1963 | | |
1921 | 1964 | | |
| |||
1986 | 2029 | | |
1987 | 2030 | | |
1988 | 2031 | | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
1989 | 2035 | | |
1990 | 2036 | | |
1991 | 2037 | | |
| |||
1994 | 2040 | | |
1995 | 2041 | | |
1996 | 2042 | | |
1997 | | - | |
| 2043 | + | |
1998 | 2044 | | |
1999 | 2045 | | |
2000 | 2046 | | |
| |||
2047 | 2093 | | |
2048 | 2094 | | |
2049 | 2095 | | |
2050 | | - | |
| 2096 | + | |
2051 | 2097 | | |
2052 | 2098 | | |
2053 | 2099 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 37 | + | |
41 | 38 | | |
42 | | - | |
43 | 39 | | |
44 | 40 | | |
45 | 41 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 11 | | |
15 | 12 | | |
| 13 | + | |
16 | 14 | | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
0 commit comments