### Zmanim Class - Example Usage Source: https://hebcal.github.io/api/core/classes/Zmanim Example demonstrating how to instantiate the Zmanim class and calculate candle lighting time. It shows how to create a GeoLocation object, initialize Zmanim for a specific date, and format the output. ```javascript const {GeoLocation, Zmanim} = require('@hebcal/core'); const latitude = 41.822232; const longitude = -71.448292; const tzid = 'America/New_York'; const friday = new Date(2023, 8, 8); const gloc = new GeoLocation(null, latitude, longitude, 0, tzid); const zmanim = new Zmanim(gloc, friday, false); const candleLighting = zmanim.sunsetOffset(-18, true); const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting); ``` -------------------------------- ### MevarchimChodeshEvent Example Source: https://hebcal.github.io/api/core/classes/MevarchimChodeshEvent Demonstrates creating MevarchimChodeshEvent instances with different dates and flags, and checking their observedInIsrael status. ```javascript constev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedInIsrael(); // false constev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedInIsrael(); // true ``` -------------------------------- ### CandleLightingEvent Example Usage Source: https://hebcal.github.io/api/core/classes/CandleLightingEvent Example code demonstrating the creation and usage of CandleLightingEvent objects, including setting observation status and checking observation locations. ```javascript const ev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedIn(false); // true ev1.observedIn(true); // false const ev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedIn(false); // true ev2.observedIn(true); // true ``` -------------------------------- ### Hebcal Core Usage Example Source: https://hebcal.github.io/api/core/index Provides a comprehensive example of using the HebrewCalendar class from @hebcal/core. It demonstrates how to set calendar options, including year, location, and specific features like candle lighting and sedrot, and then iterate through the generated events. ```javascript import {HebrewCalendar, HDate, Location, Event} from'@hebcal/core'; constoptions: CalOptions = { year:1981, isHebrewYear:false, candlelighting:true, location:Location.lookup('San Francisco'), sedrot:true, oomer:true, }; constevents = HebrewCalendar.calendar(options); for (constevofevents) { consthd = ev.getDate(); constdate = hd.greg(); console.log(date.toLocaleDateString(), ev.render('en'), hd.toString()); } ``` -------------------------------- ### YomKippurKatanEvent Example Source: https://hebcal.github.io/api/core/classes/YomKippurKatanEvent Demonstrates creating and observing YomKippurKatanEvent instances. Shows how to create events with specific dates and flags, and check if they are observed in Israel. ```javascript constev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedInIsrael(); // false constev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedInIsrael(); // true ``` -------------------------------- ### OmerEvent API Documentation Source: https://hebcal.github.io/api/core/classes/OmerEvent Provides details on the methods available for OmerEvent objects, including rendering the event in different formats, getting a brief description, retrieving the sefira details, and obtaining a URL for more information. ```APIDOC render(locale?: string): string - Renders the Omer event. Optionally accepts a locale string for translation. - Overrides the base Event.render method. - Defined in src/omer.ts:238 renderBrief(locale?: string): string - Returns a brief, translated description of the Omer day (e.g., "Omer day 22") without ordinal numbers. - Optionally accepts a locale string. - Overrides the base Event.renderBrief method. - Defined in src/omer.ts:253 sefira(lang?: OmerLang): string - Returns the sefira details in the specified language. Supports English, Hebrew with nikud, or Sephardic transliteration. - Example for day 8: 'Chesed shebiGevurah' or 'חֶֽסֶד שֶׁבִּגְבוּרָה'. - Parameters: - lang: OmerLang = 'en' - Specifies the output language ('en', 'he', or 'translit'). - Defined in src/omer.ts:218 url(): string - Returns a URL to hebcal.com or sefaria.org for more details about the event. - Returns undefined if no detail page exists. - Overrides the base Event.url method. - Defined in src/omer.ts:309 ``` -------------------------------- ### Event Observation Example Source: https://hebcal.github.io/api/core/classes/RoshHashanaEvent Demonstrates how to create new events and check if they are observed in Israel using the `newEvent` and `observedInIsrael` methods. ```javascript constev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedInIsrael(); // false constev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedInIsrael(); // true ``` -------------------------------- ### Install @hebcal/core Source: https://hebcal.github.io/api/core/index Installs the @hebcal/core package using npm. This is the primary method for adding the library to your project. ```bash npm install @hebcal/core ``` -------------------------------- ### MevarchimChodeshEvent API Documentation Source: https://hebcal.github.io/api/core/classes/MevarchimChodeshEvent API documentation for the MevarchimChodeshEvent class, detailing its render, renderBrief, and url methods. ```APIDOC MevarchimChodeshEvent: render(locale?: string): string[] Returns (translated) description of this event. Parameters: locale: Optional locale name (defaults to active locale). Returns: string Overrides Event.render renderBrief(locale?: string): string[] Returns (translated) description of this event. Parameters: locale: Optional locale name (defaults to active locale). Returns: string Overrides Event.renderBrief url(): undefined | 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 Inherited from Event.url ``` -------------------------------- ### Hebcal Core API Documentation Source: https://hebcal.github.io/api/core/classes/DailyLearning Comprehensive API documentation for the Hebcal core library. This includes details on classes like DailyLearning, HebrewCalendar, and Event, as well as utility functions for date conversions and holiday lookups. ```APIDOC DailyLearning Class: constructor(options?: CalOptions) Initializes a new instance of the DailyLearning class. options: Optional configuration for the calendar. addCalendar(cal: HebrewCalendar): void Adds a HebrewCalendar instance to the DailyLearning object. cal: The HebrewCalendar instance to add. getCalendars(): HebrewCalendar[] Retrieves all HebrewCalendar instances associated with this DailyLearning object. Returns: An array of HebrewCalendar instances. getStartDate(): Date Gets the start date of the learning cycle. Returns: The start date. has(dt: Date): boolean Checks if a specific date is present in the learning cycle. dt: The date to check. Returns: True if the date is present, false otherwise. lookup(dt: Date): DailyLearningValue | null Looks up learning information for a specific date. dt: The date to look up. Returns: DailyLearningValue object or null if not found. Greg Functions: abs2greg(abs: number): Date Converts an absolute date number to a Gregorian Date object. abs: The absolute date number. Returns: The Gregorian Date object. daysInMonth(year: number, month: number): number Calculates the number of days in a given month and year. year: The year. month: The month (1-12). Returns: The number of days in the month. greg2abs(date: Date): number Converts a Gregorian Date object to an absolute date number. date: The Gregorian Date object. Returns: The absolute date number. isDate(value: any): boolean Checks if a value is a valid Date object. value: The value to check. Returns: True if the value is a Date object, false otherwise. isLeapYear(year: number): boolean Determines if a given year is a leap year. year: The year to check. Returns: True if it's a leap year, false otherwise. Holiday Event Classes: AsaraBTevetEvent, CandleLightingEvent, ChanukahEvent, FastDayEvent, HavdalahEvent, HebrewDateEvent, HolidayEvent, MevarchimChodeshEvent, MoladEvent, OmerEvent, ParshaEvent, RoshChodeshEvent, RoshHashanaEvent, TimedChanukahEvent, TimedEvent, YomKippurKatanEvent These classes represent specific types of Jewish holidays and events, providing structured data for each. Other Classes: Event, GeoLocation, HDate, HebrewCalendar, Locale, Location, Molad, NOAACalculator, Sedra, Zmanim These classes handle various aspects of Hebrew calendar calculations, location data, and time-related events. Interfaces: Headers, LocaleData Define the structure for headers and locale-specific data. Types: CalOptions, DailyLearningValue, HolidayYearMap, MonthName, OmerLang, SedraResult, StringArrayMap, TachanunResult Provide type definitions for various data structures and parameters used within the library. Variables: parshiot: string[] An array containing the names of the weekly Torah portions. version: string The current version of the Hebcal core library. Utility Functions: gematriya(num: number): string Converts a number to its Gematriya (Hebrew numeral) representation. num: The number to convert. Returns: The Gematriya string. gematriyaStrToNum(str: string): number Converts a Gematriya string to its numerical value. str: The Gematriya string. Returns: The numerical value. getHolidaysOnDate(date: Date, options?: CalOptions): HolidayEvent[] Retrieves all Jewish holidays occurring on a specific Gregorian date. date: The Gregorian date. options: Optional configuration for holiday calculation. Returns: An array of HolidayEvent objects. getSedra(date: Date, options?: CalOptions): SedraResult Gets the Torah reading portion for a given date. date: The Gregorian date. options: Optional configuration for Sedra calculation. Returns: A SedraResult object. isAssurBemlacha(date: Date, options?: CalOptions): boolean Checks if performing melacha (work) is prohibited on a given date. date: The Gregorian date. options: Optional configuration. Returns: True if melacha is prohibited, false otherwise. parshaYear(year: number, month: number, day: number, options?: CalOptions): string Determines the Parsha name for a given date. year, month, day: The Gregorian date components. options: Optional configuration. Returns: The name of the Parsha. ``` -------------------------------- ### HebrewDateEvent Methods Source: https://hebcal.github.io/api/core/classes/HebrewDateEvent Documentation for the methods available in the HebrewDateEvent class, including basename, clone, getCategories, getDate, getDesc, and getEmoji. These methods provide functionality to retrieve simplified descriptions, clone the event, get categories, retrieve the Hebrew date, get the untranslated description, and retrieve an optional emoji. ```APIDOC basename(): string 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. clone(): Event Makes a clone of this Event object Deprecated getCategories(): string[][] Returns a list of event categories getDate(): HDate Hebrew date of this event getDesc(): 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. getEmoji(): null | string Optional holiday-specific Emoji or `null`. ``` -------------------------------- ### Event Rendering and URL Generation Source: https://hebcal.github.io/api/core/classes/MoladEvent Provides methods to render brief event descriptions and generate URLs for more detailed information on hebcal.com or sefaria.org. The `renderBrief` method accepts an optional locale, while the `url` method returns a string or undefined. ```APIDOC Event.renderBrief(locale?: string): string - Renders a brief description of the event. - Parameters: - locale: Optional locale name (defaults to active locale). - Returns: A string representing the brief event description. MoladEvent.url(): undefined | 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: An array of strings representing URLs, or undefined. ``` -------------------------------- ### DailyLearning API Documentation Source: https://hebcal.github.io/api/core/classes/DailyLearning Provides methods for managing and querying daily learning calendars. This includes registering new calendars, retrieving calendar information, and looking up specific learning events. ```apidoc Class DailyLearning: Plug-ins for daily learning calendars such as Daf Yomi, Mishna Yomi, Nach Yomi, etc. Learning schedules are provided by the `@hebcal/learning` package. Constructor: new DailyLearning(): DailyLearning Initializes a new instance of the DailyLearning class. Returns: DailyLearning Methods: Static addCalendar(name: string, calendar: Function, startDate?: HDate): void Registers a new learning calendar. Parameters: name: string - The name of the calendar (case insensitive). calendar: Function - A function that returns an Event or null. startDate: HDate (Optional) - The first date for which this calendar is valid. Returns: void Static getCalendars(): string[][] Returns the names of all registered calendars. Returns: string[] - An array of calendar names. Static getStartDate(name: string): undefined | HDate Retrieves the start date for a given learning calendar. Parameters: name: string - The name of the calendar. Returns: undefined | HDate - The start date of the calendar or undefined if not found. Static has(name: string): boolean Tests to see if a learning calendar has been registered. Parameters: name: string - The name of the calendar (case insensitive). Returns: boolean - True if the calendar is registered, false otherwise. Static lookup(name: string, hd: HDate, il: boolean): null | Event Returns an event from a daily calendar for a given date. Returns `null` if there is no learning from this calendar on this date. Parameters: name: string - The name of the calendar (case insensitive). hd: HDate - The Hebrew Date. il: boolean - True for Israel, false for Diaspora. Returns: null | Event - The learning event for the specified date, or null if none exists. ``` -------------------------------- ### API Documentation: @hebcal/core Module Source: https://hebcal.github.io/api/core/types/StringArrayMap This section provides an overview of the main module '@hebcal/core', listing its exported functions, classes, enums, interfaces, and types. It serves as a central entry point for understanding the library's structure. ```APIDOC Module: @hebcal/core Description: Core library for Hebrew calendar calculations, date conversions, and holiday information. Exports: Functions: - gematriya(hebrewWord: string): number Calculates the Gematriya value of a Hebrew word. - gematriyaStrToNum(hebrewString: string): number Converts a Hebrew string to its Gematriya numerical equivalent. - getHolidaysOnDate(date: Date, options?: CalOptions): HolidayEvent[] Retrieves all Hebrew holidays occurring on a specific Gregorian date. - getSedra(date: Date, il?: boolean): SedraResult | null Determines the weekly Torah portion (Sedra) for a given date. - isAssurBemlacha(date: Date, action: string, il?: boolean): boolean Checks if a specific action is forbidden (Assur Bemlacha) on a given holiday. - parshaYear(year: number, il?: boolean): string | null Returns the Parsha name for a given Hebrew year. - abs2greg(absDate: number): Date Converts an absolute date number to a Gregorian Date object. - daysInMonth(year: number, month: number): number Calculates the number of days in a specific month of a given year. - greg2abs(date: Date): number Converts a Gregorian Date object to an absolute date number. - isDate(year: number, month: number, day: number): boolean Validates if the provided year, month, and day form a valid date. - isLeapYear(year: number): boolean Checks if a given year is a leap year. Classes: - AsaraBTevetEvent - CandleLightingEvent - ChanukahEvent - DailyLearning - Event - FastDayEvent - GeoLocation - HavdalahEvent - HebrewCalendar - HebrewDateEvent - HolidayEvent - HDate - Locale - Location - MevarchimChodeshEvent - Molad - MoladEvent - NOAACalculator - OmerEvent - ParshaEvent - RoshChodeshEvent - RoshHashanaEvent - Sedra - TimedChanukahEvent - TimedEvent - YomKippurKatanEvent - Zmanim Enums: - flags - holidayDesc - months Interfaces: - Headers - LocaleData Types: - CalOptions - DailyLearningValue - HolidayYearMap - MonthName - OmerLang - SedraResult - StringArrayMap - TachanunResult Variables: - parshiot: string[] An array containing the names of all Parshiot. - version: string The current version of the @hebcal/core library. Related Modules: - @hebcal/core/greg: Gregorian date utility functions. - @hebcal/core/locale: Locale-specific data and functions. ``` -------------------------------- ### Get Hebcal Core Version Source: https://hebcal.github.io/api/core/variables/version Retrieves the current version of the hebcal/core library. This is a constant value provided by the package. ```typescript import { version } from '@hebcal/core'; console.log(`Hebcal Core Version: ${version}`); // Expected output: Hebcal Core Version: 5.10.0 ``` -------------------------------- ### Version Information Source: https://hebcal.github.io/api/core/types/DailyLearningValue Exposes the version of the `@hebcal/core` library, useful for tracking dependencies and compatibility. ```javascript import { version } from '@hebcal/core'; console.log(`@hebcal/core version: ${version}`); ``` -------------------------------- ### TimedEvent observedInIsrael Example Source: https://hebcal.github.io/api/core/classes/TimedEvent Shows how to use the observedInIsrael method for TimedEvent objects to check if an event is observed in Israel. ```javascript const ev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedInIsrael(); // false const ev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedInIsrael(); // true ``` -------------------------------- ### TimedEvent observedInDiaspora Example Source: https://hebcal.github.io/api/core/classes/TimedEvent Demonstrates the usage of the observedInDiaspora method for TimedEvent objects, indicating if an event is observed in the diaspora. ```javascript const ev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedInDiaspora(); // true const ev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedInDiaspora(); // true ``` -------------------------------- ### MoladEvent observedInDiaspora Method Source: https://hebcal.github.io/api/core/classes/MoladEvent Checks if an event is observed in the Diaspora. Returns a boolean value. Includes usage examples. ```APIDOC MoladEvent.observedInDiaspora(): boolean - Checks if the event is observed in the Diaspora. - Returns: boolean - True if observed in Diaspora, false otherwise. - Example: const ev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedInDiaspora(); // true const ev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedInDiaspora(); // true ``` -------------------------------- ### Hebcal Core API Reference Source: https://hebcal.github.io/api/core/classes/Event Comprehensive API documentation for the Hebcal core library, detailing functions, types, and variables. ```APIDOC StringArrayMap: Type definition for a map where keys are strings and values are arrays of strings. TachanunResult: Type definition for the result of a Tachanun calculation, likely containing boolean flags or specific dates. parshiot: Variable representing the list of Parshiot (Torah portions), possibly an array of strings or objects. version: Variable indicating the current version of the Hebcal library. gematriya(input: string, options?: { strict?: boolean }): number Calculates the Gematriya (numerical value of Hebrew words). - input: The Hebrew string to convert. - options.strict: If true, only allows Hebrew letters. - Returns: The numerical Gematriya value. gematriyaStrToNum(input: string, options?: { strict?: boolean }): number Converts a Hebrew string to its numerical Gematriya value. - input: The Hebrew string to convert. - options.strict: If true, only allows Hebrew letters. - Returns: The numerical Gematriya value. getHolidaysOnDate(date: Date, options?: { выходные?: boolean }): Holiday[] Retrieves all Jewish holidays occurring on a specific date. - date: The date to check for holidays. - options.выходные: If true, includes Shabbat and Yom Tov. - Returns: An array of Holiday objects. getSedra(date: Date, options?: { выходные?: boolean }): SedraInfo Determines the Torah portion (Sedra) for a given date. - date: The date to check. - options.выходные: If true, considers Shabbat and Yom Tov readings. - Returns: Information about the Sedra. isAssurBemlacha(date: Date, options?: { выходные?: boolean }): boolean Checks if performing Melacha (forbidden work) is prohibited on a given date. - date: The date to check. - options.выходные: If true, considers Shabbat and Yom Tov. - Returns: True if Melacha is prohibited, false otherwise. parshaYear(date: Date, options?: { выходные?: boolean }): number Calculates the Jewish year for a given date in relation to Parsha readings. - date: The date to check. - options.выходные: If true, considers Shabbat and Yom Tov. - Returns: The Jewish year. ``` -------------------------------- ### MoladEvent observedInIsrael Method Source: https://hebcal.github.io/api/core/classes/MoladEvent Checks if an event is observed in Israel. Returns a boolean value. Includes usage examples. ```APIDOC MoladEvent.observedInIsrael(): boolean - Checks if the event is observed in Israel. - Returns: boolean - True if observed in Israel, false otherwise. - Example: const ev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedInIsrael(); // false const ev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedInIsrael(); // true ``` -------------------------------- ### OmerEvent Class API Documentation Source: https://hebcal.github.io/api/core/classes/OmerEvent Provides detailed API documentation for the OmerEvent class, including its constructor, properties, and methods. This documentation covers how to instantiate an OmerEvent, access its properties like date and description, and use its methods for rendering and retrieving Omer-specific information. ```apidoc Class OmerEvent: Represents a day 1-49 of counting the Omer from Pesach to Shavuot Hierarchy: * Event * OmerEvent Defined in src/omer.ts:192 Constructors: constructor(date: HDate, omerDay: number): OmerEvent Parameters: date: HDate - The Hebrew date of this event. omerDay: number - The Omer day (1-49). Returns OmerEvent Overrides Event.constructor Defined in src/omer.ts:202 Properties: alarm?: string | boolean | Date Alarms are used by iCalendar feeds. Inherited from Event.alarm Defined in src/event.ts:112 date: HDate Hebrew date of this event. Inherited from Event.date Defined in src/event.ts:97 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. Inherited from Event.desc Defined in src/event.ts:104 emoji?: string Optional emoji representation for the event. Defined in src/omer.ts:200 mask: number A bitmask representing the event type. Defined in src/omer.ts:197 memo?: string An optional memo or note associated with the event. Defined in src/event.ts:119 Methods: basename(): string Returns the base name of the event. Defined in src/omer.ts:230 clone(): OmerEvent Creates a copy of the OmerEvent instance. Defined in src/omer.ts:225 getCategories(): string[] Returns an array of categories for this event. Defined in src/event.ts:140 getDate(): HDate Returns the Hebrew date of the event. Defined in src/event.ts:126 getDaysWithinWeeks(): string Returns a string representing the number of days within the current week of the Omer count. Defined in src/omer.ts:245 getDesc(): string Returns the untranslated description of the event. Defined in src/event.ts:147 getEmoji(): string | undefined Returns the optional emoji for the event. Defined in src/omer.ts:215 getFlags(): number Returns the bitmask flags for the event. Defined in src/event.ts:154 getTodayIs(): string Returns a string indicating which day of the Omer it is (e.g., "Today is 5 days, which is one week and 5 days, of the Omer"). Defined in src/omer.ts:250 getWeeks(): string Returns a string representing the number of weeks and days of the Omer count. Defined in src/omer.ts:240 observedIn(location: string): boolean Checks if the event is observed in a specific location (Israel or Diaspora). Defined in src/event.ts:161 observedInDiaspora(): boolean Checks if the event is observed in the Diaspora. Defined in src/event.ts:175 observedInIsrael(): boolean Checks if the event is observed in Israel. Defined in src/event.ts:168 render(lang: string, opts?: {}): string Renders the event description in the specified language, with optional rendering options. Defined in src/event.ts:182 renderBrief(lang: string): string Renders a brief version of the event description in the specified language. Defined in src/omer.ts:255 sefira(): string Returns a string representing the current day of the Omer count (e.g., "Day 5 of the Omer"). Defined in src/omer.ts:235 url(): string Returns the URL for the event. Defined in src/omer.ts:260 ``` -------------------------------- ### HolidayEvent observedInDiaspora() Source: https://hebcal.github.io/api/core/classes/HolidayEvent Determines if an event is observed in the Diaspora. This method is inherited from the base Event class and includes an example of its usage. ```APIDOC HolidayEvent.observedInDiaspora(): boolean - Checks if this event is observed in the Diaspora. - Returns: boolean - true if observed in the Diaspora, false otherwise. - Example: const ev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedInDiaspora(); // true const ev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedInDiaspora(); // true - Inherited from Event.observedInDiaspora(). ``` -------------------------------- ### MevarchimChodeshEvent Methods Source: https://hebcal.github.io/api/core/classes/MevarchimChodeshEvent Documentation for the methods of the MevarchimChodeshEvent class, including their signatures, return types, and inheritance. ```APIDOC basename(): string 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. Overrides Event.basename Defined in src/MevarchimChodeshEvent.ts:33 ``` ```APIDOC clone(): Event Makes a clone of this Event object Deprecated Inherited from Event.clone Defined in src/event.ts:237 ``` ```APIDOC getCategories(): string[] Returns a list of event categories Inherited from Event.getCategories Defined in src/event.ts:246 ``` ```APIDOC getDate(): HDate Hebrew date of this event Defined in src/MevarchimChodeshEvent.ts:28 ``` -------------------------------- ### Get Event URL Source: https://hebcal.github.io/api/core/classes/Event Returns a URL to hebcal.com or sefaria.org for more details about the event. Returns undefined if no detail page is available. ```javascript constev = newEvent(newHDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG); ev.url(); // 'https://www.hebcal.com/events/shavuot' ``` -------------------------------- ### Hebcal Core Variables Source: https://hebcal.github.io/api/core/classes/Zmanim Documentation for core variables in the Hebcal API, including parshiot and version. ```APIDOC parshiot: Variable containing information about weekly Torah portions. version: Variable indicating the current version of the Hebcal library. ``` -------------------------------- ### Hebcal Core Interfaces Source: https://hebcal.github.io/api/core/classes/Zmanim Documentation for core interfaces in the Hebcal API, including Headers, LocaleData. ```APIDOC Headers: Interface for HTTP headers. LocaleData: Interface for locale-specific data. ``` -------------------------------- ### HavdalahEvent observedInDiaspora Example Source: https://hebcal.github.io/api/core/classes/HavdalahEvent Shows how to use the observedInDiaspora method to determine if a Havdalah event is observed in the Diaspora. This method is inherited from TimedEvent. ```javascript constev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedInDiaspora(); // true constev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedInDiaspora(); // true ``` -------------------------------- ### HolidayEvent Methods Source: https://hebcal.github.io/api/core/classes/HolidayEvent Provides documentation for key methods of the HolidayEvent class, including observedInIsrael, render, renderBrief, url, and urlDateSuffix. These methods allow users to query event properties and retrieve formatted descriptions or URLs. ```APIDOC HolidayEvent: observedInIsrael(): boolean Is this event observed in Israel? Returns: boolean Example: const ev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedInIsrael(); // false const ev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedInIsrael(); // true render(locale?: string): string Returns (translated) description of this event. Parameters: locale: Optional locale name (defaults to active locale). Returns: string renderBrief(locale?: string): string 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: locale: Optional locale name (defaults to active locale). Returns: string url(): undefined | 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 urlDateSuffix(): string Returns a date suffix string for URLs. Returns: string ``` -------------------------------- ### HavdalahEvent observedInIsrael Example Source: https://hebcal.github.io/api/core/classes/HavdalahEvent Illustrates the usage of the observedInIsrael method to check if a Havdalah event is observed in Israel. This method is inherited from TimedEvent. ```javascript constev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedInIsrael(); // false constev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedInIsrael(); // true ``` -------------------------------- ### Event Methods Source: https://hebcal.github.io/api/core/classes/Event Documentation for various methods available on Event objects, including basename, clone, getCategories, getDate, getDesc, getEmoji, getFlags, and observedIn. ```APIDOC Event Methods: basename(): string 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 clone(): Event Makes a clone of this Event object Returns: Event Deprecated getCategories(): string[] Returns a list of event categories Returns: string[] getDate(): HDate Hebrew date of this event Returns: HDate getDesc(): 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 getEmoji(): null | string Optional holiday-specific Emoji or null. Returns: null | string getFlags(): number Bitmask of optional event flags. See flags Returns: number observedIn(il: boolean): boolean Is this event observed in Israel/Diaspora? Parameters: il: boolean Returns: boolean ``` -------------------------------- ### HavdalahEvent observedIn Example Source: https://hebcal.github.io/api/core/classes/HavdalahEvent Demonstrates how to use the observedIn method to check if an event is observed in a specific location. This method is inherited from TimedEvent. ```javascript constev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedIn(false); // true ev1.observedIn(true); // false constev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedIn(false); // true ev2.observedIn(true); // true ``` -------------------------------- ### Sedra Lookup Method Source: https://hebcal.github.io/api/core/classes/Sedra Provides a method to look up the parsha for a given Hebrew date, offering an alternative to the deprecated `get` method. ```apidoc Sedra: lookup(hd: number | HDate): string[][] Parameters: hd: number | HDate - The Hebrew date or R.D. days. Returns: string[] - An array of parshiyot names. Description: Returns the parsha (or parshiyot) read on a given Hebrew date. ``` -------------------------------- ### HolidayEvent Methods Source: https://hebcal.github.io/api/core/classes/HolidayEvent Documentation for methods available on the HolidayEvent class. This includes methods for generating a simplified event description and creating a copy of the event object. ```APIDOC HolidayEvent: basename(): string Returns a simplified, untranslated description for this event. For example, 'Erev Pesach' becomes 'Pesach'. Overrides Event.basename. clone(): HolidayEvent Makes a clone of this Event object. Overrides Event.clone. Deprecated. ``` -------------------------------- ### MoladEvent observedIn Method Source: https://hebcal.github.io/api/core/classes/MoladEvent Determines if an event is observed in Israel or the Diaspora based on the provided boolean flag. Includes usage examples. ```APIDOC MoladEvent.observedIn(il: boolean): boolean - Checks if the event is observed in Israel (if true) or Diaspora (if false). - Parameters: - il: boolean - True to check for Israel, false for Diaspora. - Returns: boolean - True if observed in the specified location, false otherwise. - Example: const ev1 = newEvent(newHDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); ev1.observedIn(false); // true ev1.observedIn(true); // false const ev2 = newEvent(newHDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); ev2.observedIn(false); // true ev2.observedIn(true); // true ``` -------------------------------- ### YomKippurKatanEvent API Documentation Source: https://hebcal.github.io/api/core/classes/YomKippurKatanEvent API documentation for the YomKippurKatanEvent class, detailing its methods for rendering event details and generating URLs. ```APIDOC YomKippurKatanEvent: render(locale?: string): string Description: Renders the event details. Overrides HolidayEvent.render. Parameters: locale: Optional locale name (defaults to active locale). Returns: string Defined in: src/YomKippurKatanEvent.ts:32 renderBrief(locale?: string): string Description: Renders a brief summary of the event. Overrides HolidayEvent.renderBrief. Parameters: locale: Optional locale name (defaults to active locale). Returns: string Defined in: src/YomKippurKatanEvent.ts:40 url(): undefined | string Description: Returns a URL to hebcal.com or sefaria.org for more detail on the event. Returns `undefined` for events with no detail page. Overrides HolidayEvent.url. Returns: undefined | string Defined in: src/YomKippurKatanEvent.ts:44 urlDateSuffix(): string Description: Returns a suffix for the event's URL date. Inherited from HolidayEvent. Returns: string Defined in: src/HolidayEvent.ts:43 ```