Class Haftarah


  • public final class Haftarah
    extends Object
    Resolves which haftarah to read on the upcoming Shabbat for a given date, respecting the opentorah precedence rules encoded in SpecialReadings.scala:
       Yom Tov  >  Special Parsha  >  Chanukah  >  Rosh Chodesh  >
       Machar Chodesh  >  weekly parsha.
     
    The C library carries an independent port of these same rules (hc_haftarah.c) for the Flutter app; the two are kept in step deliberately rather than one calling the other. If you change the precedence here, change it there too. Known gap in both: opentorah's shabbatAdditionalHaftarah — the extra verses Chabad and Fes append when a Rosh Chodesh or Machar Chodesh haftarah is displaced by a higher-precedence reading — is not applied.
    • Method Detail

      • upcomingShabbat

        public static LocalDate upcomingShabbat​(LocalDate date)
        Upcoming (or same-day) Shabbat for a Gregorian date.
      • forDay

        public static List<Haftarah.Result> forDay​(LocalDate date,
                                                   Custom custom,
                                                   boolean inIsrael)
        All haftarah readings that fall ON this specific date (not the upcoming Shabbat). Empty list on days without a haftarah.
        • Shabbat → one Result (weekly or a special-day override)
        • Yom Tov weekday → one Result (festival haftarah)
        • Yom Kippur → two Results (morning + afternoon)
        • Tisha B'Av → two Results (morning + afternoon)
        • Other public fasts → one Result (afternoon only)
        • Chol HaMoed / regular weekday → empty