@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 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); // ['Vayera']
    Index
    • 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

    • 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). Note that this index is 0-based, unlike SedraResult.num which is 1-based.

      Returns HDate | null

      import {Sedra} from '@hebcal/core';
      const sedra = new Sedra(5784, false);
      sedra.find('Noach')?.toString(); // '6 Cheshvan 5784'
      sedra.find(1)?.toString(); // '6 Cheshvan 5784', by 0-based index
      // Matot and Masei are doubled in 5784, so the pair has a date...
      sedra.find('Matot-Masei')?.toString(); // '28 Tamuz 5784'
      sedra.find(['Matot', 'Masei'])?.toString(); // '28 Tamuz 5784'
      // ...but neither half is read on its own that year:
      sedra.find('Matot'); // null
    • 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';
      // Matot and Masei are doubled in 5784, so each half resolves to the
      // date of the combined reading:
      const sedra = new Sedra(5784, false);
      sedra.findContaining('Matot')?.toString(); // '28 Tamuz 5784'
      sedra.findContaining('Masei')?.toString(); // '28 Tamuz 5784'
      import {Sedra} from '@hebcal/core';
      // They are read separately in 5795, so each half has its own date, and
      // asking for the doubled name returns the date of the first half:
      const sedra = new Sedra(5795, false);
      sedra.findContaining('Matot')?.toString(); // '21 Tamuz 5795'
      sedra.findContaining('Masei')?.toString(); // '28 Tamuz 5795'
      sedra.findContaining('Matot-Masei')?.toString(); // '21 Tamuz 5795'
    • 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 Friday — returns the upcoming Shabbat's reading
      const result = sedra.lookup(new HDate(12, months.CHESHVAN, 5784));
      console.log(result.parsha); // ['Lech-Lecha']
      console.log(result.chag); // false
      console.log(result.hdate.toString()); // '13 Cheshvan 5784' (Saturday)
    • Returns details about the parsha read on Monday or Thursday for hd, or undefined if hd is not a Monday or Thursday.

      Weekday Torah readings generally begin the upcoming Shabbat parsha. When the upcoming Shabbat is a holiday, this method returns the next regular parsha instead.

      For the Tishrei weekdays before Sukkot or Simchat Torah, the weekday reading is Vezot Haberakhah even though it is not read on Shabbat.

      Parameters

      • hd: number | HDate

        Hebrew date or R.D. days

      Returns SedraResult | undefined

      import {Sedra, HDate, months} from '@hebcal/core';
      const sedra = new Sedra(5784, false);
      // Monday 8 Cheshvan — begins the upcoming Shabbat's parsha
      sedra.lookupWeekday(new HDate(8, months.CHESHVAN, 5784))?.parsha; // ['Lech-Lecha']
      // Tuesday is neither Monday nor Thursday
      sedra.lookupWeekday(new HDate(9, months.CHESHVAN, 5784)); // undefined
      // Thursday 17 Nisan — the upcoming Shabbat is Chol ha-Moed Pesach,
      // so the next regular parsha is returned instead
      sedra.lookupWeekday(new HDate(17, months.NISAN, 5784))?.parsha; // ['Achrei Mot']