Debian Codegraph @

intl/icu-patches/bug-1954138-ICU-23069-rosh-hashanah-postponement.diff

raw
1 diff --git a/intl/icu/source/i18n/hebrwcal.cpp b/intl/icu/source/i18n/hebrwcal.cpp
2 --- a/intl/icu/source/i18n/hebrwcal.cpp
3 +++ b/intl/icu/source/i18n/hebrwcal.cpp
4 @@ -441,19 +441,18 @@ int32_t startOfYear(int32_t year, UError
5 day = months * 29LL + frac / DAY_PARTS; // Whole # part of calculation
6 frac = frac % DAY_PARTS; // Time of day
7
8 int32_t wd = (day % 7); // Day of week (0 == Monday)
9
10 if (wd == 2 || wd == 4 || wd == 6) {
11 // If the 1st is on Sun, Wed, or Fri, postpone to the next day
12 day += 1;
13 - wd = (day % 7);
14 }
15 - if (wd == 1 && frac > 15*HOUR_PARTS+204 && !HebrewCalendar::isLeapYear(year) ) {
16 + else if (wd == 1 && frac > 15*HOUR_PARTS+204 && !HebrewCalendar::isLeapYear(year) ) {
17 // If the new moon falls after 3:11:20am (15h204p from the previous noon)
18 // on a Tuesday and it is not a leap year, postpone by 2 days.
19 // This prevents 356-day years.
20 day += 2;
21 }
22 else if (wd == 0 && frac > 21*HOUR_PARTS+589 && HebrewCalendar::isLeapYear(year-1) ) {
23 // If the new moon falls after 9:32:43 1/3am (21h589p from yesterday noon)
24 // on a Monday and *last* year was a leap year, postpone by 1 day.