~ruther/guix-local

ref: b57b68aba645181b78bbdbef4ad908d60da03aa7 guix-local/gnu/packages/patches/icu4c-23069-rosh-hashanah-postponement.patch -rw-r--r-- 1.4 KiB
b57b68ab — Cayetano Santos gnu: open-logic: Move to hdl 30 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Retrieved from: <https://raw.githubusercontent.com/mozilla-firefox/firefox/refs/heads/main/intl/icu-patches/bug-1954138-ICU-23069-rosh-hashanah-postponement.diff>

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