@hebcal/core 6.7.0 → 6.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +56 -52
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +3 -3
- package/dist/bundle.min.js.map +1 -1
- package/dist/esm/DailyLearning.js +1 -1
- package/dist/esm/HebrewDateEvent.js +1 -1
- package/dist/esm/HolidayEvent.d.ts +2 -2
- package/dist/esm/HolidayEvent.js +3 -5
- package/dist/esm/HolidayEvent.js.map +1 -1
- package/dist/esm/MevarchimChodeshEvent.js +1 -1
- package/dist/esm/ParshaEvent.js +1 -1
- package/dist/esm/TimedEvent.js +1 -1
- package/dist/esm/YomKippurKatanEvent.js +1 -1
- package/dist/esm/ashkenazi.po.js +1 -1
- package/dist/esm/calendar.js +4 -4
- package/dist/esm/calendar.js.map +1 -1
- package/dist/esm/candles.js +1 -1
- package/dist/esm/cities.json.js +1 -1
- package/dist/esm/event.js +2 -2
- package/dist/esm/event.js.map +1 -1
- package/dist/esm/getStartAndEnd.js +8 -6
- package/dist/esm/getStartAndEnd.js.map +1 -1
- package/dist/esm/hallel.js +1 -1
- package/dist/esm/he-x-NoNikud.po.js +2 -2
- package/dist/esm/he-x-NoNikud.po.js.map +1 -1
- package/dist/esm/he.po.js +2 -2
- package/dist/esm/he.po.js.map +1 -1
- package/dist/esm/hebcal.js +1 -1
- package/dist/esm/holidays.js +6 -5
- package/dist/esm/holidays.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/isAssurBemlacha.js +12 -4
- package/dist/esm/isAssurBemlacha.js.map +1 -1
- package/dist/esm/isAveilut.js +1 -1
- package/dist/esm/isFastDay.js +1 -1
- package/dist/esm/locale.js +1 -1
- package/dist/esm/location.js +12 -13
- package/dist/esm/location.js.map +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/molad.js +5 -5
- package/dist/esm/molad.js.map +1 -1
- package/dist/esm/moladBase.js +1 -1
- package/dist/esm/moladDate.js +1 -1
- package/dist/esm/omer.js +1 -1
- package/dist/esm/parshaName.js +1 -1
- package/dist/esm/parshaYear.js +1 -1
- package/dist/esm/pkgVersion.d.ts +1 -1
- package/dist/esm/pkgVersion.js +2 -2
- package/dist/esm/pkgVersion.js.map +1 -1
- package/dist/esm/reformatTimeStr.js +1 -1
- package/dist/esm/sedra.js +10 -14
- package/dist/esm/sedra.js.map +1 -1
- package/dist/esm/sefira.json.js +1 -1
- package/dist/esm/staticHolidays.js +1 -1
- package/dist/esm/string.js +1 -1
- package/dist/esm/tachanun.js +1 -1
- package/dist/esm/zmanim.js +1 -1
- package/package.json +1 -1
- package/po/he-x-NoNikud.po +2 -2
- package/po/he.po +2 -2
package/dist/esm/location.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.js","sources":["../../../src/location.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {GeoLocation} from '@hebcal/noaa';\nimport citiesJson from './cities.json';\nimport QuickLRU from 'quick-lru';\n\nconst classicCities = new Map<string, Location>();\n\n// Zip-Codes.com TimeZone IDs\nconst ZIPCODES_TZ_MAP: Record<string, string> = {\n '0': 'UTC',\n '4': 'America/Puerto_Rico', // Atlantic (GMT -04:00)\n '5': 'America/New_York', // Eastern (GMT -05:00)\n '6': 'America/Chicago', // Central (GMT -06:00)\n '7': 'America/Denver', // Mountain (GMT -07:00)\n '8': 'America/Los_Angeles', // Pacific (GMT -08:00)\n '9': 'America/Anchorage', // Alaska (GMT -09:00)\n '10': 'Pacific/Honolulu', // Hawaii-Aleutian Islands (GMT -10:00)\n '11': 'Pacific/Pago_Pago', // American Samoa (GMT -11:00)\n '13': 'Pacific/Funafuti', // Marshall Islands (GMT +12:00)\n '14': 'Pacific/Guam', // Guam (GMT +10:00)\n '15': 'Pacific/Palau', // Palau (GMT +9:00)\n '16': 'Pacific/Chuuk', // Micronesia (GMT +11:00)\n} as const;\n\n/** @private */\nconst timeFormatCache = new QuickLRU<string, Intl.DateTimeFormat>({\n maxSize: 120,\n});\n\n/**\n * Gets a 24-hour time formatter (e.g. 07:41 or 20:03) from cache\n * or makes a new one if needed\n * @private\n */\nfunction getFormatter(tzid: string): Intl.DateTimeFormat {\n const fmt = timeFormatCache.get(tzid);\n if (fmt) return fmt;\n const f = new Intl.DateTimeFormat('en-US', {\n timeZone: tzid,\n hour: 'numeric',\n minute: 'numeric',\n hour12: false,\n });\n timeFormatCache.set(tzid, f);\n return f;\n}\n\nfunction initClassicCities() {\n for (const entry of citiesJson) {\n const [cityName, cc, lat, lng, tzid, elev] = entry.split('|');\n const location = new Location(\n +lat,\n +lng,\n cc === 'IL',\n tzid,\n cityName,\n cc,\n undefined,\n +elev\n );\n Location.addLocation(cityName, location);\n }\n}\n\n/**\n * Class representing a geographic location for use with candle-lighting,\n * havdalah, and zmanim calculations.\n *\n * Extends {@link GeoLocation} from `@hebcal/noaa` with Jewish-calendar\n * specific data: an Israel/Diaspora flag, ISO country code, and an optional\n * geographic identifier. Also provides {@link Location.lookup} for ~60\n * built-in \"classic\" Hebcal cities.\n *\n * @example\n * import {Location} from '@hebcal/core';\n *\n * // Create a location for a custom address\n * const loc = new Location(\n * 41.85003, // latitude\n * -87.65005, // longitude\n * false, // not in Israel\n * 'America/Chicago',\n * 'Chicago, Illinois, USA',\n * 'US'\n * );\n *\n * // Or look up a built-in classic city\n * const tlv = Location.lookup('Tel Aviv');\n */\nexport class Location extends GeoLocation {\n private readonly il: boolean;\n private readonly cc?: string;\n private readonly geoid?: string | number;\n admin1?: string;\n stateName?: string;\n geo?: 'zip' | 'geoname';\n zip?: string;\n population?: number;\n asciiname?: string;\n\n /**\n * Initialize a Location instance\n * @param latitude - Latitude as a decimal, valid range -90 thru +90 (e.g. 41.85003)\n * @param longitude - Longitude as a decimal, valid range -180 thru +180 (e.g. -87.65005)\n * @param il - in Israel (true) or Diaspora (false)\n * @param tzid - Olson timezone ID, e.g. \"America/Chicago\"\n * @param [cityName] - optional descriptive city name\n * @param [countryCode] - ISO 3166 alpha-2 country code (e.g. \"FR\")\n * @param [geoid] - optional string or numeric geographic ID\n * @param [elevation] - in meters (default `0`)\n */\n constructor(\n latitude: number,\n longitude: number,\n il: boolean,\n tzid: string,\n cityName?: string,\n countryCode?: string,\n geoid?: string | number,\n elevation?: number\n ) {\n const lat = typeof latitude === 'number' ? latitude : parseFloat(latitude);\n if (isNaN(lat) || lat < -90 || lat > 90) {\n throw new RangeError(`Latitude ${latitude} out of range [-90,90]`);\n }\n const long = typeof longitude === 'number' ? longitude : parseFloat(longitude);\n if (isNaN(long) || long < -180 || long > 180) {\n throw new RangeError(`Longitude ${longitude} out of range [-180,180]`);\n }\n if (!tzid) {\n throw new RangeError('Invalid timezone');\n }\n const elev = typeof elevation === 'number' && elevation > 0 ? elevation : 0;\n if (cityName && typeof cityName !== 'string') {\n cityName = String(cityName);\n }\n super(cityName || null, lat, long, elev, tzid);\n this.il = Boolean(il);\n this.cc = countryCode;\n this.geoid = geoid;\n }\n\n /**\n * Returns `true` if this location is in Israel (uses the Israeli holiday\n * and Torah-reading schedule), `false` for the Diaspora.\n */\n getIsrael(): boolean {\n return this.il;\n }\n\n /**\n * Returns the full descriptive location name passed to the constructor,\n * or `null` if no name was provided.\n * @example\n * Location.lookup('San Francisco')?.getName(); // 'San Francisco, California, USA'\n */\n getName(): string | null {\n return this.getLocationName();\n }\n\n /**\n * Returns the location name truncated at the first comma. Useful for\n * compact display where only the city name is desired.\n *\n * Special-cased so that US locations of the form `\"Washington, DC\"` or\n * `\"Washington, D.C., ...\"` keep the `DC` / `D.C.` suffix attached.\n * @example\n * Location.lookup('San Francisco')?.getShortName(); // 'San Francisco'\n * Location.lookup('Washington DC')?.getShortName(); // 'Washington, DC'\n */\n getShortName(): string | null {\n const name = this.getLocationName();\n if (!name) return name;\n const comma = name.indexOf(', ');\n if (comma === -1) return name;\n if (this.cc === 'US' && name[comma + 2] === 'D') {\n if (name[comma + 3] === 'C') {\n return name.substring(0, comma + 4);\n } else if (name[comma + 3] === '.' && name[comma + 4] === 'C') {\n return name.substring(0, comma + 6);\n }\n }\n return name.substring(0, comma);\n }\n\n /**\n * Returns the ISO 3166 alpha-2 country code (e.g. `\"US\"`, `\"IL\"`, `\"FR\"`)\n * passed to the constructor, or `undefined` if none was provided.\n */\n getCountryCode(): string | undefined {\n return this.cc;\n }\n\n /**\n * Returns the Olson timezone identifier (e.g. `\"America/Chicago\"`).\n * Alias for `getTimeZone()` from the parent `GeoLocation` class.\n */\n getTzid(): string {\n return this.getTimeZone();\n }\n\n /**\n * Returns a cached 24-hour `Intl.DateTimeFormat` (e.g. `07:41` or `20:03`)\n * configured for this location's timezone. Formatters are memoized by\n * timezone so repeated calls do not allocate.\n * @example\n * const loc = Location.lookup('Tel Aviv')!;\n * const fmt = loc.getTimeFormatter();\n * fmt.format(new Date()); // e.g. '18:42'\n */\n getTimeFormatter(): Intl.DateTimeFormat {\n return getFormatter(this.getTimeZone());\n }\n\n /**\n * Returns the optional geographic identifier passed to the constructor\n * (typically a GeoNames numeric ID or a US Zip Code string), or\n * `undefined` if none was provided.\n */\n getGeoId(): string | number | undefined {\n return this.geoid;\n }\n\n /**\n * Creates a location object from one of 60 \"classic\" Hebcal city names.\n * The following city names are supported:\n * 'Ashdod', 'Atlanta', 'Austin', 'Baghdad', 'Beer Sheva',\n * 'Berlin', 'Baltimore', 'Bogota', 'Boston', 'Budapest',\n * 'Buenos Aires', 'Buffalo', 'Chicago', 'Cincinnati', 'Cleveland',\n * 'Dallas', 'Denver', 'Detroit', 'Eilat', 'Gibraltar', 'Haifa',\n * 'Hawaii', 'Helsinki', 'Houston', 'Jerusalem', 'Johannesburg',\n * 'Kiev', 'La Paz', 'Livingston', 'Las Vegas', 'London', 'Los Angeles',\n * 'Marseilles', 'Miami', 'Minneapolis', 'Melbourne', 'Mexico City',\n * 'Montreal', 'Moscow', 'New York', 'Omaha', 'Ottawa', 'Panama City',\n * 'Paris', 'Pawtucket', 'Petach Tikvah', 'Philadelphia', 'Phoenix',\n * 'Pittsburgh', 'Providence', 'Portland', 'Saint Louis', 'Saint Petersburg',\n * 'San Diego', 'San Francisco', 'Sao Paulo', 'Seattle', 'Sydney',\n * 'Tel Aviv', 'Tiberias', 'Toronto', 'Vancouver', 'White Plains',\n * 'Washington DC', 'Worcester'\n *\n * Lookups are case-insensitive. Returns `undefined` if the name is not\n * recognized. The list can be extended with {@link Location.addLocation}.\n * @example\n * const loc = Location.lookup('San Francisco');\n * console.log(loc?.getTzid()); // 'America/Los_Angeles'\n * @param name case-insensitive classic city name\n */\n static lookup(name: string): Location | undefined {\n if (classicCities.size === 0) {\n initClassicCities();\n }\n return classicCities.get(name.toLowerCase());\n }\n\n /**\n * Returns a JSON-serialized representation of this Location.\n * Useful for debugging and structured logging.\n */\n toString(): string {\n return JSON.stringify(this);\n }\n\n /**\n * Converts a legacy Hebcal-style timezone (a numeric GMT offset plus a\n * coarse DST region) to a standard IANA/Olson timezone ID.\n *\n * This exists to migrate data from older Hebcal versions that stored\n * timezones as GMT offset + DST scheme rather than as a full tzid.\n * @example\n * Location.legacyTzToTzid(2, 'israel'); // 'Asia/Jerusalem'\n * Location.legacyTzToTzid(0, 'eu'); // 'Europe/London'\n * Location.legacyTzToTzid(0, 'none'); // 'UTC'\n * Location.legacyTzToTzid(-5, 'none'); // 'Etc/GMT-5'\n * @param tz integer, GMT offset in hours\n * @param dst 'none', 'eu', 'usa', or 'israel'\n */\n static legacyTzToTzid(tz: number, dst: string): string | undefined {\n tz = +tz;\n if (dst === 'none') {\n if (tz === 0) {\n return 'UTC';\n } else {\n const plus = tz > 0 ? '+' : '';\n return `Etc/GMT${plus}${tz}`;\n }\n } else if (tz === 2 && dst === 'israel') {\n return 'Asia/Jerusalem';\n } else if (dst === 'eu') {\n switch (tz) {\n case -2:\n return 'Atlantic/Cape_Verde';\n case -1:\n return 'Atlantic/Azores';\n case 0:\n return 'Europe/London';\n case 1:\n return 'Europe/Paris';\n case 2:\n return 'Europe/Athens';\n default:\n break;\n }\n } else if (dst === 'usa') {\n return ZIPCODES_TZ_MAP[String(tz * -1)];\n }\n return undefined;\n }\n\n /**\n * Converts timezone info from Zip-Codes.com to a standard Olson tzid.\n * @example\n * Location.getUsaTzid('AZ', 7, 'Y') // 'America/Denver'\n * @param state two-letter all-caps US state abbreviation like 'CA'\n * @param tz positive number, 5=America/New_York, 8=America/Los_Angeles\n * @param dst single char 'Y' or 'N'\n */\n static getUsaTzid(state: string, tz: number, dst: string): string {\n tz = +tz;\n if (tz === 10 && state === 'AK') {\n return 'America/Adak';\n } else if (tz === 7 && state === 'AZ') {\n return dst === 'Y' ? 'America/Denver' : 'America/Phoenix';\n } else {\n return ZIPCODES_TZ_MAP[tz];\n }\n }\n\n /**\n * Registers a new named location with the built-in `Location.lookup()`\n * registry. Names are stored case-insensitively. Returns `false` if a\n * location with the same (lower-cased) name is already registered, and\n * `true` if successfully added.\n *\n * Use this to extend the built-in set of ~60 classic Hebcal cities with\n * your own custom locations.\n * @example\n * const tlv = new Location(32.0853, 34.7818, true,\n * 'Asia/Tel_Aviv', 'My Office, Tel Aviv', 'IL');\n * Location.addLocation('My Office', tlv); // true\n * Location.lookup('my office')?.getTzid(); // 'Asia/Tel_Aviv'\n */\n static addLocation(cityName: string, location: Location): boolean {\n const name = cityName.toLowerCase();\n if (classicCities.has(name)) {\n return false;\n }\n classicCities.set(name, location);\n return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G,CAAC,IAAI,EAAE,QAAQ,CAAC;AACjC,QAAA,OAAO,IAAI;IACb;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"location.js","sources":["../../../src/location.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {GeoLocation} from '@hebcal/noaa';\nimport citiesJson from './cities.json';\nimport QuickLRU from 'quick-lru';\n\nconst classicCities = new Map<string, Location>();\n\n// Zip-Codes.com TimeZone IDs\nconst ZIPCODES_TZ_MAP: Record<string, string> = {\n '0': 'UTC',\n '4': 'America/Puerto_Rico', // Atlantic (GMT -04:00)\n '5': 'America/New_York', // Eastern (GMT -05:00)\n '6': 'America/Chicago', // Central (GMT -06:00)\n '7': 'America/Denver', // Mountain (GMT -07:00)\n '8': 'America/Los_Angeles', // Pacific (GMT -08:00)\n '9': 'America/Anchorage', // Alaska (GMT -09:00)\n '10': 'Pacific/Honolulu', // Hawaii-Aleutian Islands (GMT -10:00)\n '11': 'Pacific/Pago_Pago', // American Samoa (GMT -11:00)\n '13': 'Pacific/Funafuti', // Marshall Islands (GMT +12:00)\n '14': 'Pacific/Guam', // Guam (GMT +10:00)\n '15': 'Pacific/Palau', // Palau (GMT +9:00)\n '16': 'Pacific/Chuuk', // Micronesia (GMT +11:00)\n} as const;\n\n/** @private */\nconst timeFormatCache = new QuickLRU<string, Intl.DateTimeFormat>({\n maxSize: 120,\n});\n\n/**\n * Gets a 24-hour time formatter (e.g. 07:41 or 20:03) from cache\n * or makes a new one if needed\n * @private\n */\nfunction getFormatter(tzid: string): Intl.DateTimeFormat {\n const fmt = timeFormatCache.get(tzid);\n if (fmt) return fmt;\n const f = new Intl.DateTimeFormat('en-US', {\n timeZone: tzid,\n hour: 'numeric',\n minute: 'numeric',\n hour12: false,\n });\n timeFormatCache.set(tzid, f);\n return f;\n}\n\nfunction initClassicCities() {\n for (const entry of citiesJson) {\n const [cityName, cc, lat, lng, tzid, elev] = entry.split('|');\n const location = new Location(\n +lat,\n +lng,\n cc === 'IL',\n tzid,\n cityName,\n cc,\n undefined,\n +elev\n );\n Location.addLocation(cityName, location);\n }\n}\n\n/**\n * Class representing a geographic location for use with candle-lighting,\n * havdalah, and zmanim calculations.\n *\n * Extends {@link GeoLocation} from `@hebcal/noaa` with Jewish-calendar\n * specific data: an Israel/Diaspora flag, ISO country code, and an optional\n * geographic identifier. Also provides {@link Location.lookup} for ~60\n * built-in \"classic\" Hebcal cities.\n *\n * @example\n * import {Location} from '@hebcal/core';\n *\n * // Create a location for a custom address\n * const loc = new Location(\n * 41.85003, // latitude\n * -87.65005, // longitude\n * false, // not in Israel\n * 'America/Chicago',\n * 'Chicago, Illinois, USA',\n * 'US'\n * );\n *\n * // Or look up a built-in classic city\n * const tlv = Location.lookup('Tel Aviv');\n */\nexport class Location extends GeoLocation {\n private readonly il: boolean;\n private readonly cc?: string;\n private readonly geoid?: string | number;\n admin1?: string;\n stateName?: string;\n geo?: 'zip' | 'geoname';\n zip?: string;\n population?: number;\n asciiname?: string;\n\n /**\n * Initialize a Location instance\n * @param latitude - Latitude as a decimal, valid range -90 thru +90 (e.g. 41.85003)\n * @param longitude - Longitude as a decimal, valid range -180 thru +180 (e.g. -87.65005)\n * @param il - in Israel (true) or Diaspora (false)\n * @param tzid - Olson timezone ID, e.g. \"America/Chicago\"\n * @param [cityName] - optional descriptive city name\n * @param [countryCode] - ISO 3166 alpha-2 country code (e.g. \"FR\")\n * @param [geoid] - optional string or numeric geographic ID\n * @param [elevation] - in meters (default `0`)\n */\n constructor(\n latitude: number,\n longitude: number,\n il: boolean,\n tzid: string,\n cityName?: string,\n countryCode?: string,\n geoid?: string | number,\n elevation?: number\n ) {\n const lat = typeof latitude === 'number' ? latitude : parseFloat(latitude);\n if (isNaN(lat) || lat < -90 || lat > 90) {\n throw new RangeError(`Latitude ${latitude} out of range [-90,90]`);\n }\n const long = typeof longitude === 'number' ? longitude : parseFloat(longitude);\n if (isNaN(long) || long < -180 || long > 180) {\n throw new RangeError(`Longitude ${longitude} out of range [-180,180]`);\n }\n if (!tzid) {\n throw new RangeError('Invalid timezone');\n }\n const elev = typeof elevation === 'number' && elevation > 0 ? elevation : 0;\n if (cityName && typeof cityName !== 'string') {\n cityName = String(cityName);\n }\n super(cityName || null, lat, long, elev, tzid);\n this.il = Boolean(il);\n this.cc = countryCode;\n if (countryCode === 'IL') {\n this.il = true;\n }\n this.geoid = geoid;\n }\n\n /**\n * Returns `true` if this location is in Israel (uses the Israeli holiday\n * and Torah-reading schedule), `false` for the Diaspora.\n */\n getIsrael(): boolean {\n return this.il;\n }\n\n /**\n * Returns the full descriptive location name passed to the constructor,\n * or `null` if no name was provided.\n * @example\n * Location.lookup('San Francisco')?.getName(); // 'San Francisco, California, USA'\n */\n getName(): string | null {\n return this.getLocationName();\n }\n\n /**\n * Returns the location name truncated at the first comma. Useful for\n * compact display where only the city name is desired.\n *\n * Special-cased so that US locations of the form `\"Washington, DC\"` or\n * `\"Washington, D.C., ...\"` keep the `DC` / `D.C.` suffix attached.\n * @example\n * Location.lookup('San Francisco')?.getShortName(); // 'San Francisco'\n * Location.lookup('Washington DC')?.getShortName(); // 'Washington, DC'\n */\n getShortName(): string | null {\n const name = this.getLocationName();\n if (!name) return name;\n const comma = name.indexOf(', ');\n if (comma === -1) return name;\n if (this.cc === 'US' && name[comma + 2] === 'D') {\n if (name[comma + 3] === 'C') {\n return name.substring(0, comma + 4);\n }\n if (name[comma + 3] === '.' && name[comma + 4] === 'C') {\n return name.substring(0, comma + 6);\n }\n }\n return name.substring(0, comma);\n }\n\n /**\n * Returns the ISO 3166 alpha-2 country code (e.g. `\"US\"`, `\"IL\"`, `\"FR\"`)\n * passed to the constructor, or `undefined` if none was provided.\n */\n getCountryCode(): string | undefined {\n return this.cc;\n }\n\n /**\n * Returns the Olson timezone identifier (e.g. `\"America/Chicago\"`).\n * Alias for `getTimeZone()` from the parent `GeoLocation` class.\n */\n getTzid(): string {\n return this.getTimeZone();\n }\n\n /**\n * Returns a cached 24-hour `Intl.DateTimeFormat` (e.g. `07:41` or `20:03`)\n * configured for this location's timezone. Formatters are memoized by\n * timezone so repeated calls do not allocate.\n * @example\n * const loc = Location.lookup('Tel Aviv')!;\n * const fmt = loc.getTimeFormatter();\n * fmt.format(new Date()); // e.g. '18:42'\n */\n getTimeFormatter(): Intl.DateTimeFormat {\n return getFormatter(this.getTimeZone());\n }\n\n /**\n * Returns the optional geographic identifier passed to the constructor\n * (typically a GeoNames numeric ID or a US Zip Code string), or\n * `undefined` if none was provided.\n */\n getGeoId(): string | number | undefined {\n return this.geoid;\n }\n\n /**\n * Creates a location object from one of 60 \"classic\" Hebcal city names.\n * The following city names are supported:\n * 'Ashdod', 'Atlanta', 'Austin', 'Baghdad', 'Beer Sheva',\n * 'Berlin', 'Baltimore', 'Bogota', 'Boston', 'Budapest',\n * 'Buenos Aires', 'Buffalo', 'Chicago', 'Cincinnati', 'Cleveland',\n * 'Dallas', 'Denver', 'Detroit', 'Eilat', 'Gibraltar', 'Haifa',\n * 'Hawaii', 'Helsinki', 'Houston', 'Jerusalem', 'Johannesburg',\n * 'Kiev', 'La Paz', 'Livingston', 'Las Vegas', 'London', 'Los Angeles',\n * 'Marseilles', 'Miami', 'Minneapolis', 'Melbourne', 'Mexico City',\n * 'Montreal', 'Moscow', 'New York', 'Omaha', 'Ottawa', 'Panama City',\n * 'Paris', 'Pawtucket', 'Petach Tikvah', 'Philadelphia', 'Phoenix',\n * 'Pittsburgh', 'Providence', 'Portland', 'Saint Louis', 'Saint Petersburg',\n * 'San Diego', 'San Francisco', 'Sao Paulo', 'Seattle', 'Sydney',\n * 'Tel Aviv', 'Tiberias', 'Toronto', 'Vancouver', 'White Plains',\n * 'Washington DC', 'Worcester'\n *\n * Lookups are case-insensitive. Returns `undefined` if the name is not\n * recognized. The list can be extended with {@link Location.addLocation}.\n * @example\n * const loc = Location.lookup('San Francisco');\n * console.log(loc?.getTzid()); // 'America/Los_Angeles'\n * @param name case-insensitive classic city name\n */\n static lookup(name: string): Location | undefined {\n if (classicCities.size === 0) {\n initClassicCities();\n }\n return classicCities.get(name.toLowerCase());\n }\n\n /**\n * Returns a JSON-serialized representation of this Location.\n * Useful for debugging and structured logging.\n */\n toString(): string {\n return JSON.stringify(this);\n }\n\n /**\n * Converts a legacy Hebcal-style timezone (a numeric GMT offset plus a\n * coarse DST region) to a standard IANA/Olson timezone ID.\n *\n * This exists to migrate data from older Hebcal versions that stored\n * timezones as GMT offset + DST scheme rather than as a full tzid.\n * @example\n * Location.legacyTzToTzid(2, 'israel'); // 'Asia/Jerusalem'\n * Location.legacyTzToTzid(0, 'eu'); // 'Europe/London'\n * Location.legacyTzToTzid(0, 'none'); // 'UTC'\n * Location.legacyTzToTzid(-5, 'none'); // 'Etc/GMT-5'\n * @param tz integer, GMT offset in hours\n * @param dst 'none', 'eu', 'usa', or 'israel'\n */\n static legacyTzToTzid(tz: number, dst: string): string | undefined {\n tz = +tz;\n if (dst === 'none') {\n if (tz === 0) {\n return 'UTC';\n }\n const plus = tz > 0 ? '+' : '';\n return `Etc/GMT${plus}${tz}`;\n }\n if (tz === 2 && dst === 'israel') {\n return 'Asia/Jerusalem';\n }\n if (dst === 'eu') {\n switch (tz) {\n case -2:\n return 'Atlantic/Cape_Verde';\n case -1:\n return 'Atlantic/Azores';\n case 0:\n return 'Europe/London';\n case 1:\n return 'Europe/Paris';\n case 2:\n return 'Europe/Athens';\n default:\n break;\n }\n }\n if (dst === 'usa') {\n return ZIPCODES_TZ_MAP[String(tz * -1)];\n }\n return undefined;\n }\n\n /**\n * Converts timezone info from Zip-Codes.com to a standard Olson tzid.\n * @example\n * Location.getUsaTzid('AZ', 7, 'Y') // 'America/Denver'\n * @param state two-letter all-caps US state abbreviation like 'CA'\n * @param tz positive number, 5=America/New_York, 8=America/Los_Angeles\n * @param dst single char 'Y' or 'N'\n */\n static getUsaTzid(state: string, tz: number, dst: string): string {\n tz = +tz;\n if (tz === 10 && state === 'AK') {\n return 'America/Adak';\n }\n if (tz === 7 && state === 'AZ') {\n return dst === 'Y' ? 'America/Denver' : 'America/Phoenix';\n }\n return ZIPCODES_TZ_MAP[tz];\n }\n\n /**\n * Registers a new named location with the built-in `Location.lookup()`\n * registry. Names are stored case-insensitively. Returns `false` if a\n * location with the same (lower-cased) name is already registered, and\n * `true` if successfully added.\n *\n * Use this to extend the built-in set of ~60 classic Hebcal cities with\n * your own custom locations.\n * @example\n * const tlv = new Location(32.0853, 34.7818, true,\n * 'Asia/Tel_Aviv', 'My Office, Tel Aviv', 'IL');\n * Location.addLocation('My Office', tlv); // true\n * Location.lookup('my office')?.getTzid(); // 'Asia/Tel_Aviv'\n */\n static addLocation(cityName: string, location: Location): boolean {\n const name = cityName.toLowerCase();\n if (classicCities.has(name)) {\n return false;\n }\n classicCities.set(name, location);\n return true;\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAKH,MAAM,aAAa,GAAG,IAAI,GAAG,EAAoB;AAEjD;AACA,MAAM,eAAe,GAA2B;AAC9C,IAAA,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,mBAAmB;IACxB,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,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AACxB,gBAAA,KAAK,CAAC;AACJ,oBAAA,OAAO,cAAc;AACvB,gBAAA,KAAK,CAAC;AACJ,oBAAA,OAAO,eAAe;;QAI5B;AACA,QAAA,IAAI,GAAG,KAAK,KAAK,EAAE;YACjB,OAAO,eAAe,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACzC;AACA,QAAA,OAAO,SAAS;IAClB;AAEA;;;;;;;AAOG;AACH,IAAA,OAAO,UAAU,CAAC,KAAa,EAAE,EAAU,EAAE,GAAW,EAAA;QACtD,EAAE,GAAG,CAAC,EAAE;QACR,IAAI,EAAE,KAAK,EAAE,IAAI,KAAK,KAAK,IAAI,EAAE;AAC/B,YAAA,OAAO,cAAc;QACvB;QACA,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,EAAE;YAC9B,OAAO,GAAG,KAAK,GAAG,GAAG,gBAAgB,GAAG,iBAAiB;QAC3D;AACA,QAAA,OAAO,eAAe,CAAC,EAAE,CAAC;IAC5B;AAEA;;;;;;;;;;;;;AAaG;AACH,IAAA,OAAO,WAAW,CAAC,QAAgB,EAAE,QAAkB,EAAA;AACrD,QAAA,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE;AACnC,QAAA,IAAI,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AAC3B,YAAA,OAAO,KAAK;QACd;AACA,QAAA,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC;AACjC,QAAA,OAAO,IAAI;IACb;AACD;;;;"}
|
package/dist/esm/modern.js
CHANGED
package/dist/esm/molad.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.8.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import 'temporal-polyfill/global';
|
|
3
3
|
import { Event, flags } from './event.js';
|
|
4
4
|
import { HDate, Locale, pad2 } from '@hebcal/hdate';
|
|
@@ -40,7 +40,7 @@ function getDayNames(locale) {
|
|
|
40
40
|
if (Locale.isHebrewLocale(locale)) {
|
|
41
41
|
return heDayNames;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
if (locale === 'fr') {
|
|
44
44
|
return frDoW;
|
|
45
45
|
}
|
|
46
46
|
return enDoW;
|
|
@@ -48,11 +48,11 @@ function getDayNames(locale) {
|
|
|
48
48
|
function getHebrewTimeOfDay(hour) {
|
|
49
49
|
if (hour < 5)
|
|
50
50
|
return night;
|
|
51
|
-
|
|
51
|
+
if (hour < 12)
|
|
52
52
|
return 'בַּבֹּקֶר';
|
|
53
|
-
|
|
53
|
+
if (hour < 17)
|
|
54
54
|
return 'בַּצׇּהֳרַיִים';
|
|
55
|
-
|
|
55
|
+
if (hour < 21)
|
|
56
56
|
return 'בָּעֶרֶב';
|
|
57
57
|
return night;
|
|
58
58
|
}
|
package/dist/esm/molad.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"molad.js","sources":["../../../src/molad.ts"],"sourcesContent":["import 'temporal-polyfill/global';\nimport {Event, flags} from './event';\nimport {CalOptions} from './CalOptions';\nimport {HDate, Locale, pad2} from '@hebcal/hdate';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport {MoladBase, calculateMolad} from './moladBase';\nimport {getMoladAsDate} from './moladDate';\nimport {smartApostrophe} from './string';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst enDoW = [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n] as const;\n\nconst heDayNames = [\n 'רִאשׁוֹן',\n 'שֵׁנִי',\n 'שְׁלִישִׁי',\n 'רְבִיעִי',\n 'חֲמִישִׁי',\n 'שִׁישִּׁי',\n 'שַׁבָּת',\n] as const;\n\nconst frDoW = [\n 'Dimanche',\n 'Lundi',\n 'Mardi',\n 'Mercredi',\n 'Jeudi',\n 'Vendredi',\n 'Samedi',\n] as const;\nconst night = 'בַּלַּ֥יְלָה';\n\nfunction getDayNames(locale?: string): readonly string[] {\n if (Locale.isHebrewLocale(locale)) {\n return heDayNames;\n } else if (locale === 'fr') {\n return frDoW;\n }\n return enDoW;\n}\n\nfunction getHebrewTimeOfDay(hour: number): string {\n if (hour < 5) return night;\n else if (hour < 12) return 'בַּבֹּקֶר';\n else if (hour < 17) return 'בַּצׇּהֳרַיִים';\n else if (hour < 21) return 'בָּעֶרֶב';\n return night;\n}\n\n/**\n * Represents a *molad* — the calculated moment when the new moon is \"born\"\n * for a given Hebrew month.\n *\n * The molad is announced in synagogue on Shabbat Mevarchim (the Shabbat\n * before Rosh Chodesh) and is the anchor point for Kiddush Levana zmanim.\n * Calculations use the traditional chalakim arithmetic\n * (1 hour = 1080 chalakim) anchored to *Molad Tohu BaHaRaD*.\n *\n * @example\n * import {Molad, months} from '@hebcal/core';\n * const m = new Molad(5784, months.NISAN);\n * console.log(m.getMonthName()); // 'Nisan'\n * console.log(m.getHour(), m.getMinutes(), m.getChalakim()); // e.g. 1 31 12\n * console.log(m.render('en')); // 'Molad Nisan: Mon, 1:31am and 12 chalakim'\n */\nexport class Molad {\n private readonly m: MoladBase;\n private readonly year: number;\n private readonly month: number;\n private instant?: Temporal.ZonedDateTime;\n\n /**\n * Calculates the molad for a given Hebrew year and month.\n * @param year Hebrew year\n * @param month 1=NISAN, 7=TISHREI (uses Nisan-based numbering)\n */\n constructor(year: number, month: number) {\n this.m = calculateMolad(year, month);\n this.year = year;\n this.month = month;\n }\n /**\n * The exact Hebrew date of the molad, which often falls on the\n * 28th or 30th of the preceeding month, occasionally on the first of the\n * month, and in extremely rare circumstances the 27th of the month.\n * - Molad Shevat 5541 occured on 27 Tevet / 1781-01-24T19:57:20.170Z\n * - Molad Shevat 5788 will occur on 27 Tevet / 2028-01-26T19:07:03.504Z\n * - Molad Nissan 5866 will occur on 27 Adar II / 2106-04-03T21:08:46.837Z\n */\n getMoladDate(): HDate {\n return this.m.hdate;\n }\n /**\n * The year of the molad (as constructed)\n */\n getYear(): number {\n return this.year;\n }\n /**\n * The month (1=NISSAN, 7=TISHREI) as constructed\n */\n getMonth(): number {\n return this.month;\n }\n /**\n * Returns a transliterated string name of the molad's Hebrew month,\n * for example 'Elul' or 'Cheshvan'.\n */\n getMonthName(): string {\n return HDate.getMonthName(this.month, this.year);\n }\n /**\n * @returns Day of Week (0=Sunday, 6=Saturday)\n */\n getDow(): number {\n return this.m.hdate.getDay();\n }\n /**\n * @returns hour of day (0-23)\n */\n getHour(): number {\n return this.m.hour;\n }\n /**\n * @returns minutes past hour (0-59)\n */\n getMinutes(): number {\n return this.m.minutes;\n }\n /**\n * @returns parts of a minute (0-17)\n */\n getChalakim(): number {\n return this.m.chalakim;\n }\n /**\n * Returns the molad in Standard Time in Yerushalayim as a `Temporal.ZonedDateTime`.\n * This method subtracts 20.94 minutes (20 minutes and 56.496 seconds) from the computed time (Har Habayis with a longitude\n * of 35.2354° is 5.2354° away from the %15 timezone longitude) to get to standard time. This method\n * intentionally uses standard time and not daylight savings time.\n *\n * The returned value is cached after the first call.\n * @example\n * import {Molad, months} from '@hebcal/core';\n * const m = new Molad(5784, months.NISAN);\n * const zdt = m.getInstant();\n * console.log(zdt.toString()); // e.g. '2024-04-08T17:21:13.333+00:00[UTC]'\n * @return the `Temporal.ZonedDateTime` representing the moment of the molad\n */\n getInstant(): Temporal.ZonedDateTime {\n this.instant ??= getMoladAsDate(this.m);\n return this.instant;\n }\n /**\n * Returns the earliest time of _Kiddush Levana_ calculated as 3 days after the molad. This method returns the time\n * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider\n * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment 3 days after the molad.\n */\n getTchilasZmanKidushLevana3Days(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n return zdt.add({hours: 72});\n }\n\n /**\n * Returns the earliest time of Kiddush Levana calculated as 7 days after the molad as mentioned by the <a\n * href=\"https://en.wikipedia.org/wiki/Yosef_Karo\">Mechaber</a>. See the <a\n * href=\"https://en.wikipedia.org/wiki/Yoel_Sirkis\">Bach's</a> opinion on this time. This method returns the time\n * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider\n * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment 7 days after the molad.\n */\n getTchilasZmanKidushLevana7Days(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n return zdt.add({hours: 168});\n }\n\n /**\n * Returns the latest time of Kiddush Levana according to the <a\n * href=\"https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin\">Maharil's</a> opinion that it is calculated as\n * halfway between molad and molad. This adds half the 29 days, 12 hours and 793 chalakim time between molad and\n * molad (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's molad. This method returns the time\n * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider\n * displaying _alos_ before this time if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment halfway between molad and molad.\n */\n getSofZmanKidushLevanaBetweenMoldos(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n // add half the time between molad and molad (half of 29 days, 12 hours and 793 chalakim (44 minutes, 3.3\n // seconds), or 14 days, 18 hours, 22 minutes and 666 milliseconds). Add it as hours, not days, to avoid\n // DST/ST crossover issues.\n return zdt.add({\n hours: 24 * 14 + 18,\n minutes: 22,\n seconds: 1,\n milliseconds: 666,\n });\n }\n\n /**\n * Returns the latest time of Kiddush Levana calculated as 15 days after the molad. This is the opinion brought down\n * in the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the\n * <a href=\"https://en.wikipedia.org/wiki/Moses_Isserles\">Rema</a> who brings down the opinion of the <a\n * href=\"https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin\">Maharil's</a> of calculating\n * {@link Molad.getSofZmanKidushLevanaBetweenMoldos() half way between molad and mold} is of the opinion that Mechaber\n * agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject, See Rabbi Dovid\n * Heber's very detailed writeup in Siman Daled (chapter 4) of <a\n * href=\"https://www.worldcat.org/oclc/461326125\">Shaarei Zmanim</a>. This method returns the time even if it is during\n * the day when _Kiddush Levana_ can't be said. Callers of this method should consider displaying _alos_\n * before this time if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment 15 days after the molad.\n */\n getSofZmanKidushLevana15Days(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n // 15 days after the molad. Add it as hours, not days, to avoid DST/ST crossover issues.\n return zdt.add({hours: 24 * 15});\n }\n\n /**\n * Returns a human-readable, localized string announcing the molad —\n * suitable for use on Shabbat Mevarchim. The format includes the Hebrew\n * month name, day of week, hour : minute, and chalakim if non-zero.\n *\n * Time format honors `options.hour12` and `options.location` (12-hour vs.\n * 24-hour); see {@link HebrewCalendar.reformatTimeStr}.\n * @example\n * import {Molad, months} from '@hebcal/core';\n * const m = new Molad(5784, months.NISAN);\n * m.render('en', {hour12: true});\n * // => 'Molad Nisan: Mon, 7:21pm and 6 chalakim'\n * m.render('he');\n * // => 'מוֹלָד נִיסָן יִהְיֶה בַּיּוֹם שֵׁנִי בשָׁבוּעַ, …'\n * @param [locale] Optional locale name (defaults to empty locale)\n * @param options used for time formatting (12-hour vs 24-hour)\n */\n render(locale?: string, options?: CalOptions): string {\n const monthName = Locale.gettext(this.getMonthName(), locale);\n const dayNames = getDayNames(locale);\n const dow = dayNames[this.getDow()];\n const minutes = this.getMinutes();\n const hour = this.getHour();\n const chalakim = this.getChalakim();\n const moladStr = Locale.gettext('Molad', locale);\n const minutesStr = Locale.lookupTranslation('min', locale) ?? 'minutes';\n const chalakimStr = Locale.gettext('chalakim', locale);\n const and = Locale.gettext('and', locale);\n if (Locale.isHebrewLocale(locale)) {\n const ampm = getHebrewTimeOfDay(hour);\n let result =\n `${moladStr} ${monthName} יִהְיֶה בַּיּוֹם ${dow} בשָׁבוּעַ, ` +\n `בְּשָׁעָה ${hour} ${ampm}, ` +\n `ו-${minutes} ${minutesStr}`;\n if (chalakim !== 0) {\n result += ` ו-${chalakim} ${chalakimStr}`;\n }\n if (locale!.toLocaleLowerCase() === 'he-x-nonikud') {\n return Locale.hebrewStripNikkud(result);\n }\n return result;\n }\n const fmtTime = reformatTimeStr(`${hour}:${pad2(minutes)}`, 'pm', options);\n const month = smartApostrophe(monthName);\n const result = `${moladStr} ${month}: ${dow}, ${fmtTime}`;\n if (chalakim === 0) {\n return result;\n }\n return result + ` ${and} ${chalakim} ${chalakimStr}`;\n }\n}\n\n/** Represents a Molad announcement on Shabbat Mevarchim */\nexport class MoladEvent extends Event {\n readonly molad: Molad;\n private readonly options: CalOptions;\n /**\n * @param date Hebrew date event occurs\n * @param hyear molad year\n * @param hmonth molad month\n * @param options\n */\n constructor(date: HDate, hyear: number, hmonth: number, options: CalOptions) {\n const m = new Molad(hyear, hmonth);\n const monthName = m.getMonthName();\n super(date, `Molad ${monthName} ${hyear}`, flags.MOLAD);\n this.molad = m;\n this.options = options;\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return this.molad.render(locale, this.options);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAUA,MAAM,KAAK,GAAG;IACZ,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV,QAAQ;IACR,UAAU;CACF;AAEV,MAAM,UAAU,GAAG;IACjB,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,WAAW;IACX,WAAW;IACX,SAAS;CACD;AAEV,MAAM,KAAK,GAAG;IACZ,UAAU;IACV,OAAO;IACP,OAAO;IACP,UAAU;IACV,OAAO;IACP,UAAU;IACV,QAAQ;CACA;AACV,MAAM,KAAK,GAAG,cAAc;AAE5B,SAAS,WAAW,CAAC,MAAe,EAAA;AAClC,IAAA,IAAI,MAAM,CAAC,cAA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A,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC;IAChD;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"molad.js","sources":["../../../src/molad.ts"],"sourcesContent":["import 'temporal-polyfill/global';\nimport {Event, flags} from './event';\nimport {CalOptions} from './CalOptions';\nimport {HDate, Locale, pad2} from '@hebcal/hdate';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport {MoladBase, calculateMolad} from './moladBase';\nimport {getMoladAsDate} from './moladDate';\nimport {smartApostrophe} from './string';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst enDoW = [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n] as const;\n\nconst heDayNames = [\n 'רִאשׁוֹן',\n 'שֵׁנִי',\n 'שְׁלִישִׁי',\n 'רְבִיעִי',\n 'חֲמִישִׁי',\n 'שִׁישִּׁי',\n 'שַׁבָּת',\n] as const;\n\nconst frDoW = [\n 'Dimanche',\n 'Lundi',\n 'Mardi',\n 'Mercredi',\n 'Jeudi',\n 'Vendredi',\n 'Samedi',\n] as const;\nconst night = 'בַּלַּ֥יְלָה';\n\nfunction getDayNames(locale?: string): readonly string[] {\n if (Locale.isHebrewLocale(locale)) {\n return heDayNames;\n }\n if (locale === 'fr') {\n return frDoW;\n }\n return enDoW;\n}\n\nfunction getHebrewTimeOfDay(hour: number): string {\n if (hour < 5) return night;\n if (hour < 12) return 'בַּבֹּקֶר';\n if (hour < 17) return 'בַּצׇּהֳרַיִים';\n if (hour < 21) return 'בָּעֶרֶב';\n return night;\n}\n\n/**\n * Represents a *molad* — the calculated moment when the new moon is \"born\"\n * for a given Hebrew month.\n *\n * The molad is announced in synagogue on Shabbat Mevarchim (the Shabbat\n * before Rosh Chodesh) and is the anchor point for Kiddush Levana zmanim.\n * Calculations use the traditional chalakim arithmetic\n * (1 hour = 1080 chalakim) anchored to *Molad Tohu BaHaRaD*.\n *\n * @example\n * import {Molad, months} from '@hebcal/core';\n * const m = new Molad(5784, months.NISAN);\n * console.log(m.getMonthName()); // 'Nisan'\n * console.log(m.getHour(), m.getMinutes(), m.getChalakim()); // e.g. 1 31 12\n * console.log(m.render('en')); // 'Molad Nisan: Mon, 1:31am and 12 chalakim'\n */\nexport class Molad {\n private readonly m: MoladBase;\n private readonly year: number;\n private readonly month: number;\n private instant?: Temporal.ZonedDateTime;\n\n /**\n * Calculates the molad for a given Hebrew year and month.\n * @param year Hebrew year\n * @param month 1=NISAN, 7=TISHREI (uses Nisan-based numbering)\n */\n constructor(year: number, month: number) {\n this.m = calculateMolad(year, month);\n this.year = year;\n this.month = month;\n }\n /**\n * The exact Hebrew date of the molad, which often falls on the\n * 28th or 30th of the preceeding month, occasionally on the first of the\n * month, and in extremely rare circumstances the 27th of the month.\n * - Molad Shevat 5541 occured on 27 Tevet / 1781-01-24T19:57:20.170Z\n * - Molad Shevat 5788 will occur on 27 Tevet / 2028-01-26T19:07:03.504Z\n * - Molad Nissan 5866 will occur on 27 Adar II / 2106-04-03T21:08:46.837Z\n */\n getMoladDate(): HDate {\n return this.m.hdate;\n }\n /**\n * The year of the molad (as constructed)\n */\n getYear(): number {\n return this.year;\n }\n /**\n * The month (1=NISSAN, 7=TISHREI) as constructed\n */\n getMonth(): number {\n return this.month;\n }\n /**\n * Returns a transliterated string name of the molad's Hebrew month,\n * for example 'Elul' or 'Cheshvan'.\n */\n getMonthName(): string {\n return HDate.getMonthName(this.month, this.year);\n }\n /**\n * @returns Day of Week (0=Sunday, 6=Saturday)\n */\n getDow(): number {\n return this.m.hdate.getDay();\n }\n /**\n * @returns hour of day (0-23)\n */\n getHour(): number {\n return this.m.hour;\n }\n /**\n * @returns minutes past hour (0-59)\n */\n getMinutes(): number {\n return this.m.minutes;\n }\n /**\n * @returns parts of a minute (0-17)\n */\n getChalakim(): number {\n return this.m.chalakim;\n }\n /**\n * Returns the molad in Standard Time in Yerushalayim as a `Temporal.ZonedDateTime`.\n * This method subtracts 20.94 minutes (20 minutes and 56.496 seconds) from the computed time (Har Habayis with a longitude\n * of 35.2354° is 5.2354° away from the %15 timezone longitude) to get to standard time. This method\n * intentionally uses standard time and not daylight savings time.\n *\n * The returned value is cached after the first call.\n * @example\n * import {Molad, months} from '@hebcal/core';\n * const m = new Molad(5784, months.NISAN);\n * const zdt = m.getInstant();\n * console.log(zdt.toString()); // e.g. '2024-04-08T17:21:13.333+00:00[UTC]'\n * @return the `Temporal.ZonedDateTime` representing the moment of the molad\n */\n getInstant(): Temporal.ZonedDateTime {\n this.instant ??= getMoladAsDate(this.m);\n return this.instant;\n }\n /**\n * Returns the earliest time of _Kiddush Levana_ calculated as 3 days after the molad. This method returns the time\n * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider\n * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment 3 days after the molad.\n */\n getTchilasZmanKidushLevana3Days(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n return zdt.add({hours: 72});\n }\n\n /**\n * Returns the earliest time of Kiddush Levana calculated as 7 days after the molad as mentioned by the <a\n * href=\"https://en.wikipedia.org/wiki/Yosef_Karo\">Mechaber</a>. See the <a\n * href=\"https://en.wikipedia.org/wiki/Yoel_Sirkis\">Bach's</a> opinion on this time. This method returns the time\n * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider\n * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment 7 days after the molad.\n */\n getTchilasZmanKidushLevana7Days(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n return zdt.add({hours: 168});\n }\n\n /**\n * Returns the latest time of Kiddush Levana according to the <a\n * href=\"https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin\">Maharil's</a> opinion that it is calculated as\n * halfway between molad and molad. This adds half the 29 days, 12 hours and 793 chalakim time between molad and\n * molad (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's molad. This method returns the time\n * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider\n * displaying _alos_ before this time if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment halfway between molad and molad.\n */\n getSofZmanKidushLevanaBetweenMoldos(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n // add half the time between molad and molad (half of 29 days, 12 hours and 793 chalakim (44 minutes, 3.3\n // seconds), or 14 days, 18 hours, 22 minutes and 666 milliseconds). Add it as hours, not days, to avoid\n // DST/ST crossover issues.\n return zdt.add({\n hours: 24 * 14 + 18,\n minutes: 22,\n seconds: 1,\n milliseconds: 666,\n });\n }\n\n /**\n * Returns the latest time of Kiddush Levana calculated as 15 days after the molad. This is the opinion brought down\n * in the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the\n * <a href=\"https://en.wikipedia.org/wiki/Moses_Isserles\">Rema</a> who brings down the opinion of the <a\n * href=\"https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin\">Maharil's</a> of calculating\n * {@link Molad.getSofZmanKidushLevanaBetweenMoldos() half way between molad and mold} is of the opinion that Mechaber\n * agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject, See Rabbi Dovid\n * Heber's very detailed writeup in Siman Daled (chapter 4) of <a\n * href=\"https://www.worldcat.org/oclc/461326125\">Shaarei Zmanim</a>. This method returns the time even if it is during\n * the day when _Kiddush Levana_ can't be said. Callers of this method should consider displaying _alos_\n * before this time if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment 15 days after the molad.\n */\n getSofZmanKidushLevana15Days(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n // 15 days after the molad. Add it as hours, not days, to avoid DST/ST crossover issues.\n return zdt.add({hours: 24 * 15});\n }\n\n /**\n * Returns a human-readable, localized string announcing the molad —\n * suitable for use on Shabbat Mevarchim. The format includes the Hebrew\n * month name, day of week, hour : minute, and chalakim if non-zero.\n *\n * Time format honors `options.hour12` and `options.location` (12-hour vs.\n * 24-hour); see {@link HebrewCalendar.reformatTimeStr}.\n * @example\n * import {Molad, months} from '@hebcal/core';\n * const m = new Molad(5784, months.NISAN);\n * m.render('en', {hour12: true});\n * // => 'Molad Nisan: Mon, 7:21pm and 6 chalakim'\n * m.render('he');\n * // => 'מוֹלָד נִיסָן יִהְיֶה בַּיּוֹם שֵׁנִי בשָׁבוּעַ, …'\n * @param [locale] Optional locale name (defaults to empty locale)\n * @param options used for time formatting (12-hour vs 24-hour)\n */\n render(locale?: string, options?: CalOptions): string {\n const monthName = Locale.gettext(this.getMonthName(), locale);\n const dayNames = getDayNames(locale);\n const dow = dayNames[this.getDow()];\n const minutes = this.getMinutes();\n const hour = this.getHour();\n const chalakim = this.getChalakim();\n const moladStr = Locale.gettext('Molad', locale);\n const minutesStr = Locale.lookupTranslation('min', locale) ?? 'minutes';\n const chalakimStr = Locale.gettext('chalakim', locale);\n const and = Locale.gettext('and', locale);\n if (Locale.isHebrewLocale(locale)) {\n const ampm = getHebrewTimeOfDay(hour);\n let result =\n `${moladStr} ${monthName} יִהְיֶה בַּיּוֹם ${dow} בשָׁבוּעַ, ` +\n `בְּשָׁעָה ${hour} ${ampm}, ` +\n `ו-${minutes} ${minutesStr}`;\n if (chalakim !== 0) {\n result += ` ו-${chalakim} ${chalakimStr}`;\n }\n if (locale!.toLocaleLowerCase() === 'he-x-nonikud') {\n return Locale.hebrewStripNikkud(result);\n }\n return result;\n }\n const fmtTime = reformatTimeStr(`${hour}:${pad2(minutes)}`, 'pm', options);\n const month = smartApostrophe(monthName);\n const result = `${moladStr} ${month}: ${dow}, ${fmtTime}`;\n if (chalakim === 0) {\n return result;\n }\n return result + ` ${and} ${chalakim} ${chalakimStr}`;\n }\n}\n\n/** Represents a Molad announcement on Shabbat Mevarchim */\nexport class MoladEvent extends Event {\n readonly molad: Molad;\n private readonly options: CalOptions;\n /**\n * @param date Hebrew date event occurs\n * @param hyear molad year\n * @param hmonth molad month\n * @param options\n */\n constructor(date: HDate, hyear: number, hmonth: number, options: CalOptions) {\n const m = new Molad(hyear, hmonth);\n const monthName = m.getMonthName();\n super(date, `Molad ${monthName} ${hyear}`, flags.MOLAD);\n this.molad = m;\n this.options = options;\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return this.molad.render(locale, this.options);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAUA,MAAM,KAAK,GAAG;IACZ,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV,QAAQ;IACR,UAAU;CACF;AAEV,MAAM,UAAU,GAAG;IACjB,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,WAAW;IACX,WAAW;IACX,SAAS;CACD;AAEV,MAAM,KAAK,GAAG;IACZ,UAAU;IACV,OAAO;IACP,OAAO;IACP,UAAU;IACV,OAAO;IACP,UAAU;IACV,QAAQ;CACA;AACV,MAAM,KAAK,GAAG,cAAc;AAE5B,SAAS,WAAW,CAAC,MAAe,EAAA;AAClC,IAAA,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;AACjC,QAAA,OAAO,UAAU;IACnB;AACA,IAAA,IAAI,MAAM,KAAK,IAAI,EAAE;AACnB,QAAA,OAAO,KAAK;IACd;AACA,IAAA,OAAO,KAAK;AACd;AAEA,SAAS,kBAAkB,CAAC,IAAY,EAAA;IACtC,IAAI,IAAI,GAAG,CAAC;AAAE,QAAA,OAAO,KAAK;IAC1B,IAAI,IAAI,GAAG,EAAE;AAAE,QAAA,OAAO,WAAW;IACjC,IAAI,IAAI,GAAG,EAAE;AAAE,QAAA,OAAO,gBAAgB;IACtC,IAAI,IAAI,GAAG,EAAE;AAAE,QAAA,OAAO,UAAU;AAChC,IAAA,OAAO,KAAK;AACd;AAEA;;;;;;;;;;;;;;;AAeG;MACU,KAAK,CAAA;AACC,IAAA,CAAC;AACD,IAAA,IA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,KAAK,CAAC,EAAE;AAClB,YAAA,OAAO,MAAM;QACf;QACA,OAAO,MAAM,GAAG,CAAA,CAAA,EAAI,GAAG,IAAI,QAAQ,CAAA,CAAA,EAAI,WAAW,CAAA,CAAE;IACtD;AACD;AAED;AACM,MAAO,UAAW,SAAQ,KAAK,CAAA;AAC1B,IAAA,KAAK;AACG,IAAA,OAAO;AACxB;;;;;AAKG;AACH,IAAA,WAAA,CAAY,IAAW,EAAE,KAAa,EAAE,MAAc,EAAE,OAAmB,EAAA;QACzE,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC;AAClC,QAAA,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,EAAE;AAClC,QAAA,KAAK,CAAC,IAAI,EAAE,CAAA,MAAA,EAAS,SAAS,CAAA,CAAA,EAAI,KAAK,CAAA,CAAE,EAAE,KAAK,CAAC,KAAK,CAAC;AACvD,QAAA,IAAI,CAAC,KAAK,GAAG,CAAC;AACd,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;IACxB;AACA;;AAEG;AACH,IAAA,MAAM,CAAC,MAAe,EAAA;AACpB,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC;IAChD;AACD;;;;"}
|
package/dist/esm/moladBase.js
CHANGED
package/dist/esm/moladDate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.8.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import 'temporal-polyfill/global';
|
|
3
3
|
import { getTimezoneOffset } from '@hebcal/hdate';
|
|
4
4
|
|
package/dist/esm/omer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.8.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { Locale, gematriya } from '@hebcal/hdate';
|
|
3
3
|
import { Event, flags } from './event.js';
|
|
4
4
|
import './locale.js';
|
package/dist/esm/parshaName.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.8.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import './locale.js';
|
|
3
3
|
import { smartApostrophe } from './string.js';
|
|
4
4
|
import { Locale } from '@hebcal/hdate';
|
package/dist/esm/parshaYear.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.8.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { HDate, months } from '@hebcal/hdate';
|
|
3
3
|
import { ParshaEvent } from './ParshaEvent.js';
|
|
4
4
|
import { getSedra } from './sedra.js';
|
package/dist/esm/pkgVersion.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
2
|
-
export declare const version = "6.
|
|
2
|
+
export declare const version = "6.8.1";
|
package/dist/esm/pkgVersion.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.8.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
3
|
-
const version = '6.
|
|
3
|
+
const version = '6.8.1';
|
|
4
4
|
|
|
5
5
|
export { version };
|
|
6
6
|
//# sourceMappingURL=pkgVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '6.
|
|
1
|
+
{"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '6.8.1';\n"],"names":[],"mappings":";AAAA;AACO,MAAM,OAAO,GAAG;;;;"}
|
package/dist/esm/sedra.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.8.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { HDate, months } from '@hebcal/hdate';
|
|
3
3
|
import QuickLRU from 'quick-lru';
|
|
4
4
|
import './locale.js';
|
|
@@ -43,12 +43,10 @@ function yearType(hyear) {
|
|
|
43
43
|
if (longC && !shortK) {
|
|
44
44
|
return COMPLETE;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
if (!longC && shortK) {
|
|
47
47
|
return INCOMPLETE;
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
return REGULAR;
|
|
51
|
-
}
|
|
49
|
+
return REGULAR;
|
|
52
50
|
}
|
|
53
51
|
/**
|
|
54
52
|
* Represents the weekly Torah-reading (Parashat HaShavua) schedule for an
|
|
@@ -137,23 +135,21 @@ class Sedra {
|
|
|
137
135
|
}
|
|
138
136
|
return this.findInternal(parsha);
|
|
139
137
|
}
|
|
140
|
-
|
|
138
|
+
if (typeof parsha === 'string') {
|
|
141
139
|
const num = parsha2id.get(parsha);
|
|
142
140
|
if (typeof num === 'number') {
|
|
143
141
|
return this.find(num);
|
|
144
142
|
}
|
|
145
|
-
|
|
143
|
+
if (parsha.includes('-')) {
|
|
146
144
|
if (parsha === CHMPESACH || parsha === CHMSUKOT) {
|
|
147
145
|
return this.findInternal(parsha);
|
|
148
146
|
}
|
|
149
147
|
return this.find(parsha.split('-'));
|
|
150
148
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return this.findInternal(parsha);
|
|
154
|
-
}
|
|
149
|
+
// try to find Saturday holiday like 'Yom Kippur'
|
|
150
|
+
return this.findInternal(parsha);
|
|
155
151
|
}
|
|
156
|
-
|
|
152
|
+
if (Array.isArray(parsha)) {
|
|
157
153
|
const plen = parsha.length;
|
|
158
154
|
if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {
|
|
159
155
|
throw new TypeError(`Invalid parsha argument: ${JSON.stringify(parsha)}`);
|
|
@@ -292,7 +288,7 @@ class Sedra {
|
|
|
292
288
|
if (isNaN(abs)) {
|
|
293
289
|
throw new TypeError(`Bad date argument: ${hd}`);
|
|
294
290
|
}
|
|
295
|
-
|
|
291
|
+
if (abs < this.rh) {
|
|
296
292
|
throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);
|
|
297
293
|
}
|
|
298
294
|
// find the first saturday on or after today's date
|
|
@@ -343,7 +339,7 @@ class Sedra {
|
|
|
343
339
|
if (isNaN(abs)) {
|
|
344
340
|
throw new TypeError(`Bad date argument: ${hd}`);
|
|
345
341
|
}
|
|
346
|
-
|
|
342
|
+
if (abs < this.rh) {
|
|
347
343
|
throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);
|
|
348
344
|
}
|
|
349
345
|
const hdate = new HDate(abs);
|
package/dist/esm/sedra.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sedra.js","sources":["../../../src/sedra.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n/*\n * Many of the following algorithms were taken from hebrew calendar\n * routines by Maimonedes, from his Mishneh Torah, and implemented by\n * Nachum Dershowitz Department of Computer Science\n * (217) 333-4219 University of Illinois at Urbana-Champaign\n * nachum@cs.uiuedu 1304 West Springfield Avenue\n * Urbana, Illinois 61801\n *\n * The routines were included in the emacs 19 distribution.\n *\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst INCOMPLETE = 0;\nconst REGULAR = 1;\nconst COMPLETE = 2;\n\nfunction yearType(hyear: number): number {\n const longC = HDate.longCheshvan(hyear);\n const shortK = HDate.shortKislev(hyear);\n if (longC && !shortK) {\n return COMPLETE;\n } else if (!longC && shortK) {\n return INCOMPLETE;\n } else {\n return REGULAR;\n }\n}\n\n/** The result from `Sedra.lookup()` */\nexport type SedraResult = {\n /**\n * Name of the parsha (or parshiyot) read on\n * Hebrew date, e.g. `['Noach']` or `['Matot', 'Masei']`\n */\n parsha: string[];\n /**\n * False if this is a regular parashat HaShavua reading.\n * True if it's a special holiday reading.\n */\n chag: boolean;\n /**\n * The parsha number (or numbers) using 1-indexing.\n * A `number` for a regular (single) parsha, and a `number[]`\n * for a doubled parsha.\n * For Parashat *Bereshit*, `num` would be equal to `1`, and for\n * *Matot-Masei* it would be `[42, 43]`\n * For a chag (holiday) reading, `num` will be `0`.\n */\n num: number | number[];\n /** The date of the Shabbat this parsha is read */\n hdate: HDate;\n /** true if Israel, false for Diaspora */\n il: boolean;\n};\n\n/**\n * Represents the weekly Torah-reading (Parashat HaShavua) schedule for an\n * entire Hebrew year.\n *\n * The schedule depends on the year's *keviyah* — the day of week of Rosh\n * Hashana, whether the year is leap, whether Cheshvan/Kislev are long or\n * short, and whether the schedule is for Israel or the Diaspora (since\n * Israel and the Diaspora diverge in some years when the 8th day of Pesach\n * or the 2nd day of Shavuot fall on Shabbat).\n *\n * Prefer {@link getSedra} (or {@link HebrewCalendar.getSedra}) over\n * calling this constructor directly, since both cache their results.\n *\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * const result = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n */\nexport class Sedra {\n private readonly year: number;\n private readonly il: boolean;\n private readonly rh: number;\n private readonly firstSaturday: number;\n private readonly theSedraArray: readonly NumberOrString[];\n private readonly yearKey: string;\n /**\n * Calculates the Parashat HaShavua schedule for an entire Hebrew year.\n * @param hyear - Hebrew year (e.g. 5749)\n * @param il - Use Israel sedra schedule (false for Diaspora)\n */\n constructor(hyear: number, il: boolean) {\n hyear = +hyear;\n this.year = hyear;\n\n const rh0 = new HDate(1, months.TISHREI, hyear);\n const rh = (this.rh = rh0.abs());\n const rhDay = rh0.getDay() + 1;\n\n // find the first Saturday on or after Rosh Hashana\n this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);\n const leap = +HDate.isLeapYear(hyear);\n this.il = Boolean(il);\n\n const type = yearType(hyear);\n let key = `${leap}${rhDay}${type}`;\n if (types[key]) {\n this.theSedraArray = types[key];\n this.yearKey = key;\n } else {\n key = key + +this.il; // cast to num, then concat\n this.theSedraArray = types[key];\n this.yearKey = key;\n }\n\n if (!this.theSedraArray) {\n throw new Error(`improper sedra year type ${key} calculated for ${hyear}`);\n }\n }\n\n /**\n * Returns the date a parsha is read this year, or `null` if it does not\n * occur in this year's schedule.\n *\n * A doubled parsha (e.g. `'Matot-Masei'`) will only return a date in years\n * where that pair is actually read together; in years where they are read\n * separately, this returns `null`. Use {@link findContaining} to find the\n * date a parsha is read regardless of whether it is doubled.\n *\n * Throws `RangeError` for an out-of-range numeric input or an invalid\n * doubled-parsha pair, and `TypeError` for a malformed array argument.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * sedra.find('Noach')?.toString(); // '15 Cheshvan 5784'\n * sedra.find(1)?.toString(); // same, by 0-based index\n * sedra.find('Matot-Masei')?.toString(); // null in 5784 — read separately\n * sedra.find(['Matot', 'Masei']); // also null in 5784\n * @param parsha if a `string`, specified with Sephardic transliterations\n * like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element\n * array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should\n * be a 0-based parsha index (`0` for Bereshit, `1` for Noach) or a negative\n * number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei)\n */\n find(parsha: number | string | string[]): HDate | null {\n if (typeof parsha === 'number') {\n if (parsha >= parshiot.length || (parsha < 0 && !isValidDouble(parsha))) {\n throw new RangeError(`Invalid parsha number: ${parsha}`);\n }\n return this.findInternal(parsha);\n } else if (typeof parsha === 'string') {\n const num = parsha2id.get(parsha);\n if (typeof num === 'number') {\n return this.find(num);\n } else if (parsha.includes('-')) {\n if (parsha === CHMPESACH || parsha === CHMSUKOT) {\n return this.findInternal(parsha);\n }\n return this.find(parsha.split('-'));\n } else {\n // try to find Saturday holiday like 'Yom Kippur'\n return this.findInternal(parsha);\n }\n } else if (Array.isArray(parsha)) {\n const plen = parsha.length;\n if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {\n throw new TypeError(`Invalid parsha argument: ${JSON.stringify(parsha)}`);\n }\n if (plen === 1) {\n return this.find(parsha[0]);\n }\n const p1 = parsha[0];\n const p2 = parsha[1];\n const num1 = parsha2id.get(p1);\n const num2 = parsha2id.get(p2);\n if (\n typeof num1 !== 'number' ||\n typeof num2 !== 'number' ||\n num2 !== num1 + 1 ||\n !isValidDouble(-num1)\n ) {\n throw new RangeError(`Unrecognized parsha name: ${p1}-${p2}`);\n }\n return this.find(-num1);\n }\n return null; /* NOTREACHED */\n }\n\n private findInternal(parsha: NumberOrString): HDate | null {\n const idx = this.theSedraArray.indexOf(parsha);\n if (idx === -1) {\n return null; // doesn't occur this year\n }\n return new HDate(this.firstSaturday + idx * 7);\n }\n\n /**\n * Returns the date a parsha is read this year, looking through both\n * single and doubled forms.\n *\n * For example, if `'Matot'` is read individually this year, this returns\n * its date; if it is read as part of `'Matot-Masei'` this year, this\n * returns the date of `'Matot-Masei'` (and similarly for `'Masei'`).\n * Conversely, asking for `'Matot-Masei'` in a year where they are split\n * will return the date of `'Matot'` alone.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // Matot-Masei is split in 5784; both individual halves resolve:\n * sedra.findContaining('Matot')?.toString(); // '22 Tamuz 5784'\n * sedra.findContaining('Masei')?.toString(); // '29 Tamuz 5784'\n * // Asking for the doubled name returns the date of the first half:\n * sedra.findContaining('Matot-Masei')?.toString(); // '22 Tamuz 5784'\n */\n findContaining(parsha: number | string): HDate | null {\n const hdate = this.find(parsha);\n if (hdate) {\n return hdate;\n }\n if (typeof parsha === 'number') {\n // a valid negative number (double parsha in a year where they are\n // combined) would've been found above, and a invalid negative number\n // would've thrown an error, so this parsha must be a positive number\n // representing either p1 or p2\n const p1 = -parsha;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n // this must be the second individual parsha of a doubled pair\n // for example 29 for Kedoshim, so check for -28 for Achrei Mot-Kedoshim\n return this.find(p1 + 1);\n }\n } else {\n const num = parsha2id.get(parsha);\n if (num) {\n // parsha is either the first or second individual parsha of\n // a pair that is doubled this year\n const p1 = -num;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n return this.find(p1 + 1);\n }\n } else {\n // this was indeed a doubled parsha, so return date of the first half\n const [p1] = parsha.split('-');\n return this.find(p1);\n }\n }\n }\n\n /**\n * Returns the underlying annual reading schedule as an array, where each\n * entry corresponds to one Saturday (starting from the first Shabbat on\n * or after Rosh Hashana). Entries are either:\n * - a non-negative `number`: a 0-based parsha index (e.g. `0` for\n * *Bereshit*)\n * - a negative `number`: the negated first index of a doubled parsha\n * (e.g. `-21` for *Vayakhel-Pekudei*)\n * - a `string`: a holiday name when a Yom Tov displaces the weekly reading\n * (e.g. `'Pesach Shabbat Chol ha-Moed'`, `'Yom Kippur'`)\n *\n * Used by `@hebcal/triennial`.\n */\n getSedraArray(): readonly NumberOrString[] {\n return this.theSedraArray;\n }\n\n /**\n * Returns the R.D. (Rata Die / Fixed Date) absolute day number of the\n * first Saturday on or after Rosh Hashana of this year. This is the\n * anchor point for {@link getSedraArray} — index `0` of that array\n * corresponds to this date.\n */\n getFirstSaturday(): number {\n return this.firstSaturday;\n }\n\n /** Returns the Hebrew year this `Sedra` instance covers. */\n getYear(): number {\n return this.year;\n }\n\n /**\n * Returns details about the parsha read on the first Saturday on or after\n * `hd`. If `hd` is itself a Saturday, the reading for that date is\n * returned; otherwise the reading for the upcoming Saturday is returned.\n *\n * If the given date falls in the final days of the Hebrew year (after\n * the last reading of this year's schedule), this method transparently\n * delegates to the next year's `Sedra`.\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // A weekday — returns the upcoming Shabbat's reading\n * const result = sedra.lookup(new HDate(13, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n * console.log(result.chag); // false\n * console.log(result.hdate.toString()); // '15 Cheshvan 5784' (Saturday)\n * @param hd Hebrew date or R.D. days\n */\n lookup(hd: HDate | number): SedraResult {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n } else if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n // find the first saturday on or after today's date\n const saturday = HDate.dayOnOrBefore(6, abs + 6);\n\n const weekNum = (saturday - this.firstSaturday) / 7;\n const index = this.theSedraArray[weekNum];\n\n if (index === undefined) {\n const sedra = getSedra(this.year + 1, this.il);\n return sedra.lookup(saturday); // must be next year\n }\n const hdate = new HDate(saturday);\n if (typeof index === 'string') {\n // Shabbat has a chag. Return a description\n return {parsha: [index], chag: true, hdate, il: this.il, num: 0};\n }\n if (index >= 0) {\n return {\n parsha: [parshiot[index]],\n chag: false,\n num: index + 1,\n hdate,\n il: this.il,\n };\n }\n\n const p1 = D(index); // undouble the parsha\n return {\n parsha: [parshiot[p1], parshiot[p1 + 1]],\n chag: false,\n num: [p1 + 1, p1 + 2],\n hdate,\n il: this.il,\n };\n }\n\n /**\n * Returns details about the parsha read on Monday or Thursday for `hd`, or\n * `undefined` if `hd` is not a Monday or Thursday.\n *\n * Weekday Torah readings generally begin the upcoming Shabbat parsha. When\n * the upcoming Shabbat is a holiday, this method returns the next regular\n * parsha instead.\n *\n * For the Tishrei weekdays before Sukkot or Simchat Torah, the weekday\n * reading is *Vezot Haberakhah* even though it is not read on Shabbat.\n * @param hd Hebrew date or R.D. days\n */\n lookupWeekday(hd: HDate | number): SedraResult | undefined {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n } else if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n const hdate = new HDate(abs);\n const day = hdate.getDay();\n if (day !== 1 && day !== 4) {\n return undefined;\n }\n\n const saturday = new HDate(HDate.dayOnOrBefore(6, abs + 6));\n const parsha = this.lookup(saturday);\n if (!parsha.chag) {\n return parsha;\n }\n return this.findWeekdayParsha(saturday);\n }\n\n private findWeekdayParsha(saturday: HDate): SedraResult {\n const hyear = saturday.getFullYear();\n const il = this.il;\n\n if (saturday.getMonth() === months.TISHREI) {\n const dd = saturday.getDate();\n const simchatTorah = il ? 22 : 23;\n if (dd > 2 && dd <= simchatTorah) {\n return {\n parsha: ['Vezot Haberakhah'],\n chag: false,\n num: 54,\n hdate: saturday,\n il,\n };\n }\n }\n\n const sedra = hyear === this.year ? this : getSedra(hyear, il);\n const endOfYear = new HDate(1, months.TISHREI, hyear + 1).abs() - 1;\n const endAbs = endOfYear + 30;\n for (let sat2 = saturday.abs() + 7; sat2 <= endAbs; sat2 += 7) {\n const sedra2 = sat2 > endOfYear ? getSedra(hyear + 1, il) : sedra;\n const parsha2 = sedra2.lookup(sat2);\n if (!parsha2.chag) {\n return parsha2;\n }\n }\n /* NOTREACHED */\n throw new Error(`can't find weekday parsha for ${saturday}/${il}`);\n }\n}\n\n/**\n * The 54 parshiyot of the Torah as transilterated strings.\n * * parshiot[0] == `Bereshit`\n * * parshiot[1] == `Noach`\n * * parshiot[52] == `Ha'azinu`\n * * parshiot[53] == `Vezot Haberakhah`\n * @readonly\n * @type {string[]}\n */\nexport const parshiot: readonly string[] = [\n 'Bereshit',\n 'Noach',\n 'Lech-Lecha',\n 'Vayera',\n 'Chayei Sara',\n 'Toldot',\n 'Vayetzei',\n 'Vayishlach',\n 'Vayeshev',\n 'Miketz',\n 'Vayigash',\n 'Vayechi',\n 'Shemot',\n 'Vaera',\n 'Bo',\n 'Beshalach',\n 'Yitro',\n 'Mishpatim',\n 'Terumah',\n 'Tetzaveh',\n 'Ki Tisa',\n 'Vayakhel',\n 'Pekudei',\n 'Vayikra',\n 'Tzav',\n 'Shmini',\n 'Tazria',\n 'Metzora',\n 'Achrei Mot',\n 'Kedoshim',\n 'Emor',\n 'Behar',\n 'Bechukotai',\n 'Bamidbar',\n 'Nasso',\n \"Beha'alotcha\",\n \"Sh'lach\",\n 'Korach',\n 'Chukat',\n 'Balak',\n 'Pinchas',\n 'Matot',\n 'Masei',\n 'Devarim',\n 'Vaetchanan',\n 'Eikev',\n \"Re'eh\",\n 'Shoftim',\n 'Ki Teitzei',\n 'Ki Tavo',\n 'Nitzavim',\n 'Vayeilech',\n \"Ha'azinu\",\n 'Vezot Haberakhah',\n] as const;\n\n// 0-based parsha IDs\nconst parsha2id = new Map<string, number>();\nfor (let id = 0; id < parshiot.length; id++) {\n const name = parshiot[id];\n parsha2id.set(name, id);\n}\n\n// 0-based parsha IDs\nconst doubles = new Set([\n 21, // Vayakhel-Pekudei\n 26, // Tazria-Metzora\n 28, // Achrei Mot-Kedoshim\n 31, // Behar-Bechukotai\n 38, // Chukat-Balak\n 41, // Matot-Masei\n 50, // Nitzavim-Vayeilech\n]);\n\n/**\n * @private\n * @param id a negative number\n */\nfunction isValidDouble(id: number): boolean {\n return doubles.has(-id);\n}\n\n/**\n * parsha doubler/undoubler\n * @private\n * @param p\n */\nfunction D(p: number): number {\n return -p;\n}\n\nconst RH = 'Rosh Hashana'; // 0\nconst YK = 'Yom Kippur'; // 1\n\nconst SUKKOT = 'Sukkot'; // 0\nconst CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0\nconst SHMINI = 'Shmini Atzeret'; // 0\n\nconst PESACH = 'Pesach'; // 25\nconst PESACH1 = 'Pesach I';\nconst CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25\nconst PESACH7 = 'Pesach VII'; // 25\nconst PESACH8 = 'Pesach VIII';\nconst SHAVUOT = 'Shavuot'; // 33\n\n/**\n * Returns an array from start to end\n * @private\n * @param start beginning number, inclusive\n * @param stop ending number, inclusive\n */\nfunction range(start: number, stop: number): readonly number[] {\n return Array.from({length: stop - start + 1}, (v, k) => k + start);\n}\n\ntype NumberOrString = number | string;\n\nconst yearStartVayeilech: readonly NumberOrString[] = [51, 52, CHMSUKOT];\nconst yearStartHaazinu: readonly NumberOrString[] = [52, YK, CHMSUKOT];\nconst yearStartRH: readonly NumberOrString[] = [RH, 52, SUKKOT, SHMINI];\nconst r020 = range(0, 20);\nconst r027 = range(0, 27);\nconst r3340 = range(33, 40);\nconst r4349 = range(43, 49);\nconst r4350 = range(43, 50);\n\n/**\n * The ordinary year types (keviot)\n * names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel\n * @private\n * @readonly\n */\nconst types: Record<string, readonly NumberOrString[]> = {\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g. 5753\n '020': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n // e.g. 5756\n '0220': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n 33,\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5701\n '0510': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH1,\n PESACH8,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5745\n '0511': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH,\n 25,\n D(26),\n D(28),\n range(30, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Sunday. */\n // e.g. 5754\n '052': yearStartHaazinu.concat(\n range(0, 24),\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev\n * each have 29 days), and has Passover start on Sunday. */\n // e.g. 5761\n '070': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Tuesday. */\n // e.g. 5716\n '072': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* -- The leap year types (keviot) -- */\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1200': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1201': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1220': yearStartVayeilech.concat(\n r027,\n PESACH1,\n PESACH8,\n range(28, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1221': yearStartVayeilech.concat(r027, PESACH, range(28, 50)),\n\n /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and\n * Kislev both have 29 days), and has Passover start on Sunday. */\n // e.g. 5768\n '150': yearStartHaazinu.concat(range(0, 28), PESACH7, range(29, 50)),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev both have 30 days), and has Passover start on Tuesday. */\n // eg. 5771\n '152': yearStartHaazinu.concat(range(0, 28), CHMPESACH, range(29, 49), D(50)),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g.5757\n '170': yearStartRH.concat(r027, CHMPESACH, range(28, 40), D(41), r4349, D(50)),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n '1720': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n} as const;\n\n/* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['0221'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\n// e.g. 5715\ntypes['0310'] = types['0220'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\ntypes['0311'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n// e.g. 5715\ntypes['1310'] = types['1220'];\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\ntypes['1311'] = types['1221'];\n\n/* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['1721'] = types['170'];\n\nconst sedraCache = new QuickLRU<string, Sedra>({maxSize: 120});\n\n/**\n * Convenience function to create an instance of {@link Sedra} or reuse a\n * previously created and cached instance for the same year and schedule.\n *\n * Prefer this over `new Sedra(...)` when calling repeatedly — an internal\n * LRU cache (~120 entries) avoids recomputing the keviyah-specific schedule.\n * @example\n * import {getSedra, HDate, months} from '@hebcal/core';\n * const sedra = getSedra(5784, false);\n * const {parsha} = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(parsha); // ['Lech-Lecha']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\nexport function getSedra(hyear: number, il: boolean): Sedra {\n const cacheKey = `${hyear}-${il ? 1 : 0}`;\n let sedra = sedraCache.get(cacheKey);\n if (!sedra) {\n sedra = new Sedra(hyear, il);\n sedraCache.set(cacheKey, sedra);\n }\n return sedra;\n}\n"],"names":[],"mappings":";;;;;AAAA;;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;AAE5B;AACuE;AACvE;AACA,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AAC7B;AACuE;AACvE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AAE7B;AACoE;AACpE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;AAE5B,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAgB,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC;AAE9D;;;;;;;;;;;;;AAaG;AACG,SAAU,QAAQ,CAAC,KAAa,EAAE,EAAW,EAAA;AACjD,IAAA,MAAM,QAAQ,GAAG,CAAA,EAAG,KAAK,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE;IACzC,IAAI,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpC,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;AAC5B,QAAA,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;IACjC;AACA,IAAA,OAAO,KAAK;AACd;;;;"}
|
|
1
|
+
{"version":3,"file":"sedra.js","sources":["../../../src/sedra.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n/*\n * Many of the following algorithms were taken from hebrew calendar\n * routines by Maimonedes, from his Mishneh Torah, and implemented by\n * Nachum Dershowitz Department of Computer Science\n * (217) 333-4219 University of Illinois at Urbana-Champaign\n * nachum@cs.uiuedu 1304 West Springfield Avenue\n * Urbana, Illinois 61801\n *\n * The routines were included in the emacs 19 distribution.\n *\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst INCOMPLETE = 0;\nconst REGULAR = 1;\nconst COMPLETE = 2;\n\nfunction yearType(hyear: number): number {\n const longC = HDate.longCheshvan(hyear);\n const shortK = HDate.shortKislev(hyear);\n if (longC && !shortK) {\n return COMPLETE;\n }\n if (!longC && shortK) {\n return INCOMPLETE;\n }\n return REGULAR;\n}\n\n/** The result from `Sedra.lookup()` */\nexport type SedraResult = {\n /**\n * Name of the parsha (or parshiyot) read on\n * Hebrew date, e.g. `['Noach']` or `['Matot', 'Masei']`\n */\n parsha: string[];\n /**\n * False if this is a regular parashat HaShavua reading.\n * True if it's a special holiday reading.\n */\n chag: boolean;\n /**\n * The parsha number (or numbers) using 1-indexing.\n * A `number` for a regular (single) parsha, and a `number[]`\n * for a doubled parsha.\n * For Parashat *Bereshit*, `num` would be equal to `1`, and for\n * *Matot-Masei* it would be `[42, 43]`\n * For a chag (holiday) reading, `num` will be `0`.\n */\n num: number | number[];\n /** The date of the Shabbat this parsha is read */\n hdate: HDate;\n /** true if Israel, false for Diaspora */\n il: boolean;\n};\n\n/**\n * Represents the weekly Torah-reading (Parashat HaShavua) schedule for an\n * entire Hebrew year.\n *\n * The schedule depends on the year's *keviyah* — the day of week of Rosh\n * Hashana, whether the year is leap, whether Cheshvan/Kislev are long or\n * short, and whether the schedule is for Israel or the Diaspora (since\n * Israel and the Diaspora diverge in some years when the 8th day of Pesach\n * or the 2nd day of Shavuot fall on Shabbat).\n *\n * Prefer {@link getSedra} (or {@link HebrewCalendar.getSedra}) over\n * calling this constructor directly, since both cache their results.\n *\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * const result = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n */\nexport class Sedra {\n private readonly year: number;\n private readonly il: boolean;\n private readonly rh: number;\n private readonly firstSaturday: number;\n private readonly theSedraArray: readonly NumberOrString[];\n private readonly yearKey: string;\n /**\n * Calculates the Parashat HaShavua schedule for an entire Hebrew year.\n * @param hyear - Hebrew year (e.g. 5749)\n * @param il - Use Israel sedra schedule (false for Diaspora)\n */\n constructor(hyear: number, il: boolean) {\n hyear = +hyear;\n this.year = hyear;\n\n const rh0 = new HDate(1, months.TISHREI, hyear);\n const rh = (this.rh = rh0.abs());\n const rhDay = rh0.getDay() + 1;\n\n // find the first Saturday on or after Rosh Hashana\n this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);\n const leap = +HDate.isLeapYear(hyear);\n this.il = Boolean(il);\n\n const type = yearType(hyear);\n let key = `${leap}${rhDay}${type}`;\n if (types[key]) {\n this.theSedraArray = types[key];\n this.yearKey = key;\n } else {\n key = key + +this.il; // cast to num, then concat\n this.theSedraArray = types[key];\n this.yearKey = key;\n }\n\n if (!this.theSedraArray) {\n throw new Error(`improper sedra year type ${key} calculated for ${hyear}`);\n }\n }\n\n /**\n * Returns the date a parsha is read this year, or `null` if it does not\n * occur in this year's schedule.\n *\n * A doubled parsha (e.g. `'Matot-Masei'`) will only return a date in years\n * where that pair is actually read together; in years where they are read\n * separately, this returns `null`. Use {@link findContaining} to find the\n * date a parsha is read regardless of whether it is doubled.\n *\n * Throws `RangeError` for an out-of-range numeric input or an invalid\n * doubled-parsha pair, and `TypeError` for a malformed array argument.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * sedra.find('Noach')?.toString(); // '15 Cheshvan 5784'\n * sedra.find(1)?.toString(); // same, by 0-based index\n * sedra.find('Matot-Masei')?.toString(); // null in 5784 — read separately\n * sedra.find(['Matot', 'Masei']); // also null in 5784\n * @param parsha if a `string`, specified with Sephardic transliterations\n * like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element\n * array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should\n * be a 0-based parsha index (`0` for Bereshit, `1` for Noach) or a negative\n * number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei)\n */\n find(parsha: number | string | string[]): HDate | null {\n if (typeof parsha === 'number') {\n if (parsha >= parshiot.length || (parsha < 0 && !isValidDouble(parsha))) {\n throw new RangeError(`Invalid parsha number: ${parsha}`);\n }\n return this.findInternal(parsha);\n }\n if (typeof parsha === 'string') {\n const num = parsha2id.get(parsha);\n if (typeof num === 'number') {\n return this.find(num);\n }\n if (parsha.includes('-')) {\n if (parsha === CHMPESACH || parsha === CHMSUKOT) {\n return this.findInternal(parsha);\n }\n return this.find(parsha.split('-'));\n }\n // try to find Saturday holiday like 'Yom Kippur'\n return this.findInternal(parsha);\n }\n if (Array.isArray(parsha)) {\n const plen = parsha.length;\n if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {\n throw new TypeError(`Invalid parsha argument: ${JSON.stringify(parsha)}`);\n }\n if (plen === 1) {\n return this.find(parsha[0]);\n }\n const p1 = parsha[0];\n const p2 = parsha[1];\n const num1 = parsha2id.get(p1);\n const num2 = parsha2id.get(p2);\n if (\n typeof num1 !== 'number' ||\n typeof num2 !== 'number' ||\n num2 !== num1 + 1 ||\n !isValidDouble(-num1)\n ) {\n throw new RangeError(`Unrecognized parsha name: ${p1}-${p2}`);\n }\n return this.find(-num1);\n }\n return null; /* NOTREACHED */\n }\n\n private findInternal(parsha: NumberOrString): HDate | null {\n const idx = this.theSedraArray.indexOf(parsha);\n if (idx === -1) {\n return null; // doesn't occur this year\n }\n return new HDate(this.firstSaturday + idx * 7);\n }\n\n /**\n * Returns the date a parsha is read this year, looking through both\n * single and doubled forms.\n *\n * For example, if `'Matot'` is read individually this year, this returns\n * its date; if it is read as part of `'Matot-Masei'` this year, this\n * returns the date of `'Matot-Masei'` (and similarly for `'Masei'`).\n * Conversely, asking for `'Matot-Masei'` in a year where they are split\n * will return the date of `'Matot'` alone.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // Matot-Masei is split in 5784; both individual halves resolve:\n * sedra.findContaining('Matot')?.toString(); // '22 Tamuz 5784'\n * sedra.findContaining('Masei')?.toString(); // '29 Tamuz 5784'\n * // Asking for the doubled name returns the date of the first half:\n * sedra.findContaining('Matot-Masei')?.toString(); // '22 Tamuz 5784'\n */\n findContaining(parsha: number | string): HDate | null {\n const hdate = this.find(parsha);\n if (hdate) {\n return hdate;\n }\n if (typeof parsha === 'number') {\n // a valid negative number (double parsha in a year where they are\n // combined) would've been found above, and a invalid negative number\n // would've thrown an error, so this parsha must be a positive number\n // representing either p1 or p2\n const p1 = -parsha;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n // this must be the second individual parsha of a doubled pair\n // for example 29 for Kedoshim, so check for -28 for Achrei Mot-Kedoshim\n return this.find(p1 + 1);\n }\n } else {\n const num = parsha2id.get(parsha);\n if (num) {\n // parsha is either the first or second individual parsha of\n // a pair that is doubled this year\n const p1 = -num;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n return this.find(p1 + 1);\n }\n } else {\n // this was indeed a doubled parsha, so return date of the first half\n const [p1] = parsha.split('-');\n return this.find(p1);\n }\n }\n }\n\n /**\n * Returns the underlying annual reading schedule as an array, where each\n * entry corresponds to one Saturday (starting from the first Shabbat on\n * or after Rosh Hashana). Entries are either:\n * - a non-negative `number`: a 0-based parsha index (e.g. `0` for\n * *Bereshit*)\n * - a negative `number`: the negated first index of a doubled parsha\n * (e.g. `-21` for *Vayakhel-Pekudei*)\n * - a `string`: a holiday name when a Yom Tov displaces the weekly reading\n * (e.g. `'Pesach Shabbat Chol ha-Moed'`, `'Yom Kippur'`)\n *\n * Used by `@hebcal/triennial`.\n */\n getSedraArray(): readonly NumberOrString[] {\n return this.theSedraArray;\n }\n\n /**\n * Returns the R.D. (Rata Die / Fixed Date) absolute day number of the\n * first Saturday on or after Rosh Hashana of this year. This is the\n * anchor point for {@link getSedraArray} — index `0` of that array\n * corresponds to this date.\n */\n getFirstSaturday(): number {\n return this.firstSaturday;\n }\n\n /** Returns the Hebrew year this `Sedra` instance covers. */\n getYear(): number {\n return this.year;\n }\n\n /**\n * Returns details about the parsha read on the first Saturday on or after\n * `hd`. If `hd` is itself a Saturday, the reading for that date is\n * returned; otherwise the reading for the upcoming Saturday is returned.\n *\n * If the given date falls in the final days of the Hebrew year (after\n * the last reading of this year's schedule), this method transparently\n * delegates to the next year's `Sedra`.\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // A weekday — returns the upcoming Shabbat's reading\n * const result = sedra.lookup(new HDate(13, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n * console.log(result.chag); // false\n * console.log(result.hdate.toString()); // '15 Cheshvan 5784' (Saturday)\n * @param hd Hebrew date or R.D. days\n */\n lookup(hd: HDate | number): SedraResult {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n }\n if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n // find the first saturday on or after today's date\n const saturday = HDate.dayOnOrBefore(6, abs + 6);\n\n const weekNum = (saturday - this.firstSaturday) / 7;\n const index = this.theSedraArray[weekNum];\n\n if (index === undefined) {\n const sedra = getSedra(this.year + 1, this.il);\n return sedra.lookup(saturday); // must be next year\n }\n const hdate = new HDate(saturday);\n if (typeof index === 'string') {\n // Shabbat has a chag. Return a description\n return {parsha: [index], chag: true, hdate, il: this.il, num: 0};\n }\n if (index >= 0) {\n return {\n parsha: [parshiot[index]],\n chag: false,\n num: index + 1,\n hdate,\n il: this.il,\n };\n }\n\n const p1 = D(index); // undouble the parsha\n return {\n parsha: [parshiot[p1], parshiot[p1 + 1]],\n chag: false,\n num: [p1 + 1, p1 + 2],\n hdate,\n il: this.il,\n };\n }\n\n /**\n * Returns details about the parsha read on Monday or Thursday for `hd`, or\n * `undefined` if `hd` is not a Monday or Thursday.\n *\n * Weekday Torah readings generally begin the upcoming Shabbat parsha. When\n * the upcoming Shabbat is a holiday, this method returns the next regular\n * parsha instead.\n *\n * For the Tishrei weekdays before Sukkot or Simchat Torah, the weekday\n * reading is *Vezot Haberakhah* even though it is not read on Shabbat.\n * @param hd Hebrew date or R.D. days\n */\n lookupWeekday(hd: HDate | number): SedraResult | undefined {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n }\n if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n const hdate = new HDate(abs);\n const day = hdate.getDay();\n if (day !== 1 && day !== 4) {\n return undefined;\n }\n\n const saturday = new HDate(HDate.dayOnOrBefore(6, abs + 6));\n const parsha = this.lookup(saturday);\n if (!parsha.chag) {\n return parsha;\n }\n return this.findWeekdayParsha(saturday);\n }\n\n private findWeekdayParsha(saturday: HDate): SedraResult {\n const hyear = saturday.getFullYear();\n const il = this.il;\n\n if (saturday.getMonth() === months.TISHREI) {\n const dd = saturday.getDate();\n const simchatTorah = il ? 22 : 23;\n if (dd > 2 && dd <= simchatTorah) {\n return {\n parsha: ['Vezot Haberakhah'],\n chag: false,\n num: 54,\n hdate: saturday,\n il,\n };\n }\n }\n\n const sedra = hyear === this.year ? this : getSedra(hyear, il);\n const endOfYear = new HDate(1, months.TISHREI, hyear + 1).abs() - 1;\n const endAbs = endOfYear + 30;\n for (let sat2 = saturday.abs() + 7; sat2 <= endAbs; sat2 += 7) {\n const sedra2 = sat2 > endOfYear ? getSedra(hyear + 1, il) : sedra;\n const parsha2 = sedra2.lookup(sat2);\n if (!parsha2.chag) {\n return parsha2;\n }\n }\n /* NOTREACHED */\n throw new Error(`can't find weekday parsha for ${saturday}/${il}`);\n }\n}\n\n/**\n * The 54 parshiyot of the Torah as transilterated strings.\n * * parshiot[0] == `Bereshit`\n * * parshiot[1] == `Noach`\n * * parshiot[52] == `Ha'azinu`\n * * parshiot[53] == `Vezot Haberakhah`\n * @readonly\n * @type {string[]}\n */\nexport const parshiot: readonly string[] = [\n 'Bereshit',\n 'Noach',\n 'Lech-Lecha',\n 'Vayera',\n 'Chayei Sara',\n 'Toldot',\n 'Vayetzei',\n 'Vayishlach',\n 'Vayeshev',\n 'Miketz',\n 'Vayigash',\n 'Vayechi',\n 'Shemot',\n 'Vaera',\n 'Bo',\n 'Beshalach',\n 'Yitro',\n 'Mishpatim',\n 'Terumah',\n 'Tetzaveh',\n 'Ki Tisa',\n 'Vayakhel',\n 'Pekudei',\n 'Vayikra',\n 'Tzav',\n 'Shmini',\n 'Tazria',\n 'Metzora',\n 'Achrei Mot',\n 'Kedoshim',\n 'Emor',\n 'Behar',\n 'Bechukotai',\n 'Bamidbar',\n 'Nasso',\n \"Beha'alotcha\",\n \"Sh'lach\",\n 'Korach',\n 'Chukat',\n 'Balak',\n 'Pinchas',\n 'Matot',\n 'Masei',\n 'Devarim',\n 'Vaetchanan',\n 'Eikev',\n \"Re'eh\",\n 'Shoftim',\n 'Ki Teitzei',\n 'Ki Tavo',\n 'Nitzavim',\n 'Vayeilech',\n \"Ha'azinu\",\n 'Vezot Haberakhah',\n] as const;\n\n// 0-based parsha IDs\nconst parsha2id = new Map<string, number>();\nfor (let id = 0; id < parshiot.length; id++) {\n const name = parshiot[id];\n parsha2id.set(name, id);\n}\n\n// 0-based parsha IDs\nconst doubles = new Set([\n 21, // Vayakhel-Pekudei\n 26, // Tazria-Metzora\n 28, // Achrei Mot-Kedoshim\n 31, // Behar-Bechukotai\n 38, // Chukat-Balak\n 41, // Matot-Masei\n 50, // Nitzavim-Vayeilech\n]);\n\n/**\n * @private\n * @param id a negative number\n */\nfunction isValidDouble(id: number): boolean {\n return doubles.has(-id);\n}\n\n/**\n * parsha doubler/undoubler\n * @private\n * @param p\n */\nfunction D(p: number): number {\n return -p;\n}\n\nconst RH = 'Rosh Hashana'; // 0\nconst YK = 'Yom Kippur'; // 1\n\nconst SUKKOT = 'Sukkot'; // 0\nconst CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0\nconst SHMINI = 'Shmini Atzeret'; // 0\n\nconst PESACH = 'Pesach'; // 25\nconst PESACH1 = 'Pesach I';\nconst CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25\nconst PESACH7 = 'Pesach VII'; // 25\nconst PESACH8 = 'Pesach VIII';\nconst SHAVUOT = 'Shavuot'; // 33\n\n/**\n * Returns an array from start to end\n * @private\n * @param start beginning number, inclusive\n * @param stop ending number, inclusive\n */\nfunction range(start: number, stop: number): readonly number[] {\n return Array.from({length: stop - start + 1}, (v, k) => k + start);\n}\n\ntype NumberOrString = number | string;\n\nconst yearStartVayeilech: readonly NumberOrString[] = [51, 52, CHMSUKOT];\nconst yearStartHaazinu: readonly NumberOrString[] = [52, YK, CHMSUKOT];\nconst yearStartRH: readonly NumberOrString[] = [RH, 52, SUKKOT, SHMINI];\nconst r020 = range(0, 20);\nconst r027 = range(0, 27);\nconst r3340 = range(33, 40);\nconst r4349 = range(43, 49);\nconst r4350 = range(43, 50);\n\n/**\n * The ordinary year types (keviot)\n * names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel\n * @private\n * @readonly\n */\nconst types: Record<string, readonly NumberOrString[]> = {\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g. 5753\n '020': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n // e.g. 5756\n '0220': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n 33,\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5701\n '0510': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH1,\n PESACH8,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5745\n '0511': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH,\n 25,\n D(26),\n D(28),\n range(30, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Sunday. */\n // e.g. 5754\n '052': yearStartHaazinu.concat(\n range(0, 24),\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev\n * each have 29 days), and has Passover start on Sunday. */\n // e.g. 5761\n '070': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Tuesday. */\n // e.g. 5716\n '072': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* -- The leap year types (keviot) -- */\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1200': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1201': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1220': yearStartVayeilech.concat(\n r027,\n PESACH1,\n PESACH8,\n range(28, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1221': yearStartVayeilech.concat(r027, PESACH, range(28, 50)),\n\n /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and\n * Kislev both have 29 days), and has Passover start on Sunday. */\n // e.g. 5768\n '150': yearStartHaazinu.concat(range(0, 28), PESACH7, range(29, 50)),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev both have 30 days), and has Passover start on Tuesday. */\n // eg. 5771\n '152': yearStartHaazinu.concat(range(0, 28), CHMPESACH, range(29, 49), D(50)),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g.5757\n '170': yearStartRH.concat(r027, CHMPESACH, range(28, 40), D(41), r4349, D(50)),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n '1720': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n} as const;\n\n/* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['0221'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\n// e.g. 5715\ntypes['0310'] = types['0220'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\ntypes['0311'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n// e.g. 5715\ntypes['1310'] = types['1220'];\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\ntypes['1311'] = types['1221'];\n\n/* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['1721'] = types['170'];\n\nconst sedraCache = new QuickLRU<string, Sedra>({maxSize: 120});\n\n/**\n * Convenience function to create an instance of {@link Sedra} or reuse a\n * previously created and cached instance for the same year and schedule.\n *\n * Prefer this over `new Sedra(...)` when calling repeatedly — an internal\n * LRU cache (~120 entries) avoids recomputing the keviyah-specific schedule.\n * @example\n * import {getSedra, HDate, months} from '@hebcal/core';\n * const sedra = getSedra(5784, false);\n * const {parsha} = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(parsha); // ['Lech-Lecha']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\nexport function getSedra(hyear: number, il: boolean): Sedra {\n const cacheKey = `${hyear}-${il ? 1 : 0}`;\n let sedra = sedraCache.get(cacheKey);\n if (!sedra) {\n sedra = new Sedra(hyear, il);\n sedraCache.set(cacheKey, sedra);\n }\n return sedra;\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAEH;;;;;;;;;;AAUG;AAKH,MAAM,UAAU,GAAG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AC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AAE7B;AACoE;AACpE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;AAE5B,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAgB,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC;AAE9D;;;;;;;;;;;;;AAaG;AACG,SAAU,QAAQ,CAAC,KAAa,EAAE,EAAW,EAAA;AACjD,IAAA,MAAM,QAAQ,GAAG,CAAA,EAAG,KAAK,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE;IACzC,IAAI,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpC,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;AAC5B,QAAA,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;IACjC;AACA,IAAA,OAAO,KAAK;AACd;;;;"}
|
package/dist/esm/sefira.json.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.8.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
const ps67lines=["אֱלֹהִים יְחָנֵּנוּ וִיבָרְכֵנוּ יָאֵר־פָּנָיו אִתָּנוּ סֶלָה","לָדַעַת בָּאָרֶץ דַּרְכֶּךָ בְּכָל־גּוֹיִם יְשׁוּעָתֶךָ","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים כִּי־תִשְׁפֹּט עַמִּים מִישׁוֹר וּלְאֻמִּים בָּאָרֶץ תַּנחֵם סֶלָה","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","אֶרֶץ נָתְנָה יְבוּלָהּ יְבָרְכֵנוּ אֱלֹהִים אֱלֹהֵינוּ","יְבָרְכֵנוּ אֱלֹהִים וְיִירְאוּ אוֹתוֹ כָּל־אַפְסֵי־אָרֶץ"];const lamnatzeachLetters="ישמחווירננולאמיםכיתשפוטעמיםמישורולאמיםבארץתנחםסלה";const anaBekoach=["אָנָּא","בְּכֹחַ","גְּדֻלַּת","יְמִינְךָ","תַּתִּיר","צְרוּרָה","אב״ג ית״ץ","קַבֵּל","רִנַּת","עַמְּךָ","שַׂגְּבֵנוּ","טַהֲרֵנוּ","נוֹרָא","קר״ע שט״ן","נָא","גִבּוֹר","דּוֹרְשֵׁי","יִחוּדְךָ","כְּבָבַת","שָׁמְרֵם","נג״ד יכ״ש","בָּרְכֵם","טַהֲרֵם","רַחֲמֵי","צִדְקָתְךָ","תָּמִיד","גָּמְלֵם","בט״ר צת״ג","חֲסִין","קָדוֹשׁ","בְּרֹב","טוּבְךָ","נַהֵל","עֲדָתֶךָ","חק״ב תנ״ע","יָחִיד","גֵּאֶה","לְעַמְּךָ","פְּנֵה","זוֹכְרֵי","קְדֻשָּׁתֶךָ","יג״ל פז״ק","שַׁוְעָתֵנוּ","קַבֵּל","וּשְׁמַע","צַעֲקָתֵנוּ","יוֹדֵעַ","תַּעֲלוּמוֹת","שק״ו צי״ת"];var sefira = {ps67lines:ps67lines,lamnatzeachLetters:lamnatzeachLetters,anaBekoach:anaBekoach};
|
|
3
3
|
|
|
4
4
|
export { anaBekoach, sefira as default, lamnatzeachLetters, ps67lines };
|
package/dist/esm/string.js
CHANGED
package/dist/esm/tachanun.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.8.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { HDate, months } from '@hebcal/hdate';
|
|
3
3
|
import { dateYomHaZikaron } from './modern.js';
|
|
4
4
|
|
package/dist/esm/zmanim.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.8.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import 'temporal-polyfill/global';
|
|
3
3
|
import { NOAACalculator } from '@hebcal/noaa';
|
|
4
4
|
import { HDate, isDate, getTimezoneOffset, pad2, getPseudoISO } from '@hebcal/hdate';
|