@hebcal/core
    Preparing search index...

    Function isAssurBemlacha

    • Returns true if the given moment (date + time) falls within a period when melacha (work) is prohibited — i.e. Shabbat or a Yom Tov.

      The Shabbat/Yom Tov window is taken to begin at sunset (shkiah) on the preceding day (Erev Shabbat / Erev Yom Tov / Yom Tov sheni) and to end at tzais (nightfall) on the day itself. Tzais is calculated using a solar depression of 8.5° for simplicity; consult a halachic authority for more stringent opinions.

      useElevation controls whether the location's elevation is taken into account when computing sunset (it has no effect on the degree-based tzais calculation). The Israel/Diaspora schedule comes from location.getIsrael().

      Throws if sunset cannot be calculated for the given location (e.g. polar regions).

      Parameters

      • currentTime: Date

        the moment to test (with hour/minute)

      • location: Location

        geographic location (also supplies Israel/Diaspora flag and tzid)

      • useElevation: boolean

        include elevation when computing sunset

      Returns boolean

      true if melacha is prohibited, false if it is not

      import {isAssurBemlacha, Location} from '@hebcal/core';
      const loc = Location.lookup('Jerusalem')!;
      // Friday after sunset:
      isAssurBemlacha(new Date('2024-04-26T18:00:00Z'), loc, false); // true