@hebcal/core
    Preparing search index...

    Class Event

    Represents an Event with a title, date, and flags.

    Events are used to represent holidays, candle-lighting times, Torah readings, and more.

    To get the title of the event a language other than English with Sephardic transliterations, use the render() method.

    Hierarchy (View Summary)

    Index

    Constructors

    • Constructs Event

      Parameters

      • date: HDate

        Hebrew date event occurs

      • desc: string

        Description (not translated)

      • Optionalmask: number = 0

        optional bitmask of holiday flags (see flags)

      • Optionalattrs: object

        optional additional attributes (e.g. eventTimeStr, cholHaMoedDay)

      Returns Event

    Properties

    alarm?: string | boolean | Date

    Alarms are used by iCalendar feeds

    date: HDate

    Hebrew date of this event

    desc: string

    Untranslated title of this event. Note that these description strings are always in English and will remain stable across releases. To get the title of the event in another language, use the render() method.

    emoji?: string

    Optional emoji character such as ✡️, 🕯️, 🕎, 🕍, 🌒

    mask: number

    Bitmask of optional event flags. See flags

    memo?: string

    Optional longer description or memo text

    Methods

    • Returns a simplified (untranslated) description for this event. For example, the HolidayEvent class supports "Erev Pesach" => "Pesach", and "Sukkot III (CH''M)" => "Sukkot". For many holidays the basename and the event description are the same.

      Returns string

    • Returns a list of event categories

      Returns string[]

    • Untranslated title of this event. Note that these description strings are always in English and will remain stable across releases. To get the title of the event in another language, use the render() method.

      Returns string

    • Optional holiday-specific Emoji or null.

      Returns null | string

    • Is this event observed in Israel/Diaspora?

      Parameters

      • il: boolean

      Returns boolean

      const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
      ev1.observedIn(false); // true
      ev1.observedIn(true); // false
      const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
      ev2.observedIn(false); // true
      ev2.observedIn(true); // true
    • Is this event observed in the Diaspora?

      Returns boolean

      const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
      ev1.observedInDiaspora(); // true
      const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
      ev2.observedInDiaspora(); // true
    • Is this event observed in Israel?

      Returns boolean

      const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
      ev1.observedInIsrael(); // false
      const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
      ev2.observedInIsrael(); // true
    • Returns (translated) description of this event

      Parameters

      • Optionallocale: string

        Optional locale name (defaults to active locale).

      Returns string

      const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);
      ev.render('en'); // 'Shavuot'
      ev.render('he'); // 'שָׁבוּעוֹת'
      ev.render('ashkenazi'); // 'Shavuos'
    • Returns a brief (translated) description of this event. For most events, this is the same as render(). For some events, it procudes a shorter text (e.g. without a time or added description).

      Parameters

      • Optionallocale: string

        Optional locale name (defaults to active locale).

      Returns string

    • Returns a URL to hebcal.com or sefaria.org for more detail on the event. Returns undefined for events with no detail page.

      Returns undefined | string