@hebcal/core
    Preparing search index...

    Class Sedra

    Represents the weekly Torah-reading (Parashat HaShavua) schedule for an entire Hebrew year.

    The schedule depends on the year's keviyah — the day of week of Rosh Hashana, whether the year is leap, whether Cheshvan/Kislev are long or short, and whether the schedule is for Israel or the Diaspora (since Israel and the Diaspora diverge in some years when the 8th day of Pesach or the 2nd day of Shavuot fall on Shabbat).

    Prefer getSedra (or HebrewCalendar.getSedra) over calling this constructor directly, since both cache their results.

    import {Sedra, HDate, months} from '@hebcal/core';
    const sedra = new Sedra(5784, false);
    const result = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));
    console.log(result.parsha); // ['Lech-Lecha']
    Index

    Constructors

    • Calculates the Parashat HaShavua schedule for an entire Hebrew year.

      Parameters

      • hyear: number

        Hebrew year (e.g. 5749)

      • il: boolean

        Use Israel sedra schedule (false for Diaspora)

      Returns Sedra

    Methods

    • Returns the date a parsha is read this year, or null if it does not occur in this year's schedule.

      A doubled parsha (e.g. 'Matot-Masei') will only return a date in years where that pair is actually read together; in years where they are read separately, this returns null. Use findContaining to find the date a parsha is read regardless of whether it is doubled.

      Throws RangeError for an out-of-range numeric input or an invalid doubled-parsha pair, and TypeError for a malformed array argument.

      Parameters

      • parsha: string | number | string[]

        if a string, specified with Sephardic transliterations like 'Noach' or 'Matot-Masei'. If an array, must be a 1- or 2-element array such as ['Noach'] or ['Matot', 'Masei']. If a number, should be a 0-based parsha index (0 for Bereshit, 1 for Noach) or a negative number for a doubled parsha (e.g. -21 for Vayakhel-Pekudei)

      Returns HDate | null

      import {Sedra} from '@hebcal/core';
      const sedra = new Sedra(5784, false);
      sedra.find('Noach')?.toString(); // '15 Cheshvan 5784'
      sedra.find(1)?.toString(); // same, by 0-based index
      sedra.find('Matot-Masei')?.toString(); // null in 5784 — read separately
      sedra.find(['Matot', 'Masei']); // also null in 5784
    • Returns the date a parsha is read this year, looking through both single and doubled forms.

      For example, if 'Matot' is read individually this year, this returns its date; if it is read as part of 'Matot-Masei' this year, this returns the date of 'Matot-Masei' (and similarly for 'Masei'). Conversely, asking for 'Matot-Masei' in a year where they are split will return the date of 'Matot' alone.

      Parameters

      • parsha: string | number

      Returns HDate | null

      import {Sedra} from '@hebcal/core';
      const sedra = new Sedra(5784, false);
      // Matot-Masei is split in 5784; both individual halves resolve:
      sedra.findContaining('Matot')?.toString(); // '22 Tamuz 5784'
      sedra.findContaining('Masei')?.toString(); // '29 Tamuz 5784'
      // Asking for the doubled name returns the date of the first half:
      sedra.findContaining('Matot-Masei')?.toString(); // '22 Tamuz 5784'
    • Returns the R.D. (Rata Die / Fixed Date) absolute day number of the first Saturday on or after Rosh Hashana of this year. This is the anchor point for getSedraArray — index 0 of that array corresponds to this date.

      Returns number

    • Returns the underlying annual reading schedule as an array, where each entry corresponds to one Saturday (starting from the first Shabbat on or after Rosh Hashana). Entries are either:

      • a non-negative number: a 0-based parsha index (e.g. 0 for Bereshit)
      • a negative number: the negated first index of a doubled parsha (e.g. -21 for Vayakhel-Pekudei)
      • a string: a holiday name when a Yom Tov displaces the weekly reading (e.g. 'Pesach Shabbat Chol ha-Moed', 'Yom Kippur')

      Used by @hebcal/triennial.

      Returns readonly NumberOrString[]

    • Returns the Hebrew year this Sedra instance covers.

      Returns number

    • Returns details about the parsha read on the first Saturday on or after hd. If hd is itself a Saturday, the reading for that date is returned; otherwise the reading for the upcoming Saturday is returned.

      If the given date falls in the final days of the Hebrew year (after the last reading of this year's schedule), this method transparently delegates to the next year's Sedra.

      Parameters

      • hd: number | HDate

        Hebrew date or R.D. days

      Returns SedraResult

      import {Sedra, HDate, months} from '@hebcal/core';
      const sedra = new Sedra(5784, false);
      // A weekday — returns the upcoming Shabbat's reading
      const result = sedra.lookup(new HDate(13, months.CHESHVAN, 5784));
      console.log(result.parsha); // ['Lech-Lecha']
      console.log(result.chag); // false
      console.log(result.hdate.toString()); // '15 Cheshvan 5784' (Saturday)