@hebcal/core
Advanced tools
Comparing version 1.0.15 to 1.0.16
@@ -222,2 +222,4 @@ /// <reference types="node"/> | ||
* @property numYears - generate calendar for multiple years (default 1) | ||
* @property start - use specific start date (requires end date) | ||
* @property end - use specific end date (requires start date) | ||
* @property candlelighting - calculate candle-lighting and havdalah times | ||
@@ -244,2 +246,4 @@ * @property candleLightingMins - minutes before sundown to light candles (default 18) | ||
* @property hour12 - use 12-hour time (1-12) instead of default 24-hour time (0-23) | ||
* @property addHebrewDates - print the Hebrew date for the entire date range | ||
* @property addHebrewDatesForEvents - print the Hebrew date for dates with some events | ||
*/ | ||
@@ -252,2 +256,4 @@ export type HebcalOptions = { | ||
numYears: number; | ||
start: Date | HDate | number; | ||
end: Date | HDate | number; | ||
candlelighting: boolean; | ||
@@ -502,2 +508,40 @@ candleLightingMins: number; | ||
} | ||
export class Sedra { | ||
/** | ||
* Caculates the Parashah HaShavua for an entire Hebrew year | ||
* @param hebYr - Hebrew year (e.g. 5749) | ||
* @param il - Use Israel sedra schedule (false for Diaspora) | ||
*/ | ||
constructor(hebYr: number, il: boolean); | ||
/** | ||
* Returns the parsha (or parshiyot) read on Hebrew date | ||
* @param hDate Hebrew date or absolute days | ||
*/ | ||
get(hDate: HDate | number): string[]; | ||
/** | ||
* Looks up parsha for the date, then returns a (translated) string | ||
* @param hDate Hebrew date or absolute days | ||
*/ | ||
getString(hDate: HDate | number): string; | ||
/** | ||
* Translates object describing the parsha to a string | ||
* @param parsha | ||
*/ | ||
static parshaToString(parsha: string[]): string; | ||
/** | ||
* Returns an object describing the parsha on the first Saturday on or after absdate | ||
* @param hDate Hebrew date or absolute days | ||
*/ | ||
lookup(hDate: HDate | number): Object; | ||
/** | ||
* Checks to see if this day would be a regular parasha HaShavua | ||
* Torah reading or special holiday reading | ||
* @param hDate Hebrew date or absolute days | ||
*/ | ||
isParsha(hDate: HDate | number): boolean; | ||
getYear(): number; | ||
} | ||
export const parshiyot: string[]; | ||
} |
{ | ||
"name": "@hebcal/core", | ||
"version": "1.0.15", | ||
"version": "1.0.16", | ||
"author": "Michael J. Radwin (https://github.com/mjradwin)", | ||
@@ -49,3 +49,3 @@ "contributors": [ | ||
"prepublish": "npm run build", | ||
"po2json": "for infile in ./po/*.po; do outfile=`basename -s .po $infile`; echo $outfile; npx ttag po2json $infile --format compact > src/$outfile.po.json; done && exit 0", | ||
"po2json": "node ./po2json.js po/*.po", | ||
"readme": "npx jsdoc2md dist/index.js", | ||
@@ -52,0 +52,0 @@ "pretest": "npm run build", |
264
README.md
@@ -34,2 +34,3 @@ | ||
``` | ||
## Classes | ||
@@ -57,2 +58,5 @@ | ||
</dd> | ||
<dt><a href="#HebrewDateEvent">HebrewDateEvent</a></dt> | ||
<dd><p>Daily Hebrew date ("11th of Sivan, 5780")</p> | ||
</dd> | ||
<dt><a href="#Location">Location</a></dt> | ||
@@ -66,8 +70,23 @@ <dd><p>Class representing Location</p> | ||
## Constants | ||
## Objects | ||
<dl> | ||
<dt><a href="#cities">cities</a></dt> | ||
<dt><a href="#cities">cities</a> : <code>object</code></dt> | ||
<dd><p>Interface to lookup cities</p> | ||
</dd> | ||
<dt><a href="#common$1">common$1</a> : <code>object</code></dt> | ||
<dd><p>Common hebrew date routines</p> | ||
</dd> | ||
<dt><a href="#dafyomi$2">dafyomi$2</a> : <code>object</code></dt> | ||
<dd><p>Daf Yomi</p> | ||
</dd> | ||
<dt><a href="#greg$1">greg$1</a> : <code>object</code></dt> | ||
<dd><p>Gregorian date routines</p> | ||
</dd> | ||
<dt><a href="#holidays$1">holidays$1</a> : <code>object</code></dt> | ||
<dd><p>Lower-level holidays interface</p> | ||
</dd> | ||
<dt><a href="#hebcal">hebcal</a> : <code>object</code></dt> | ||
<dd><p>Main interface to Hebcal</p> | ||
</dd> | ||
</dl> | ||
@@ -180,2 +199,17 @@ | ||
</dd> | ||
<dt><a href="#reformatTimeStr">reformatTimeStr(timeStr, suffix, options)</a> ⇒ <code>string</code></dt> | ||
<dd><p>Returns "8:13p" for US or "20:13" for any other locale/country</p> | ||
</dd> | ||
<dt><a href="#makeAnchor">makeAnchor(s)</a> ⇒ <code>string</code></dt> | ||
<dd></dd> | ||
<dt><a href="#getHolidayBasename">getHolidayBasename(desc)</a> ⇒ <code>string</code></dt> | ||
<dd></dd> | ||
<dt><a href="#getUrlInternal">getUrlInternal(e, hostname, dirs)</a> ⇒ <code>string</code></dt> | ||
<dd></dd> | ||
<dt><a href="#getShortUrl">getShortUrl(e)</a> ⇒ <code>string</code></dt> | ||
<dd><p>Gets a short redirector URL for hebcal.com</p> | ||
</dd> | ||
<dt><a href="#getEventUrl">getEventUrl(e)</a> ⇒ <code>string</code></dt> | ||
<dd><p>Gets a regular (long, non-redirector) URL for hebcal.com</p> | ||
</dd> | ||
<dt><a href="#formatTime">formatTime(timeFormat, dt)</a> ⇒ <code>string</code></dt> | ||
@@ -191,2 +225,5 @@ <dd></dd> | ||
<dd></dd> | ||
<dt><a href="#getAbs">getAbs(d)</a> ⇒ <code>number</code></dt> | ||
<dd><p>Gets the Julian absolute days for a number, Date, or HDate</p> | ||
</dd> | ||
<dt><a href="#getStartAndEnd">getStartAndEnd(options)</a> ⇒ <code>Array.<number></code></dt> | ||
@@ -200,3 +237,3 @@ <dd><p>Parse options object to determine start & end days</p> | ||
</dd> | ||
<dt><a href="#hebcalEvents">hebcalEvents(options)</a> ⇒ <code><a href="#Event">Array.<Event></a></code></dt> | ||
<dt><a href="#hebrewCalendar">hebrewCalendar(options)</a> ⇒ <code><a href="#Event">Array.<Event></a></code></dt> | ||
<dd><p>Generates a list of holidays</p> | ||
@@ -606,2 +643,26 @@ </dd> | ||
**Kind**: instance method of [<code>CandleLightingEvent</code>](#CandleLightingEvent) | ||
<a name="HebrewDateEvent"></a> | ||
## HebrewDateEvent | ||
Daily Hebrew date ("11th of Sivan, 5780") | ||
**Kind**: global class | ||
* [HebrewDateEvent](#HebrewDateEvent) | ||
* [new HebrewDateEvent(date, locale)](#new_HebrewDateEvent_new) | ||
* [.render()](#HebrewDateEvent+render) ⇒ <code>string</code> | ||
<a name="new_HebrewDateEvent_new"></a> | ||
### new HebrewDateEvent(date, locale) | ||
| Param | Type | | ||
| --- | --- | | ||
| date | [<code>HDate</code>](#HDate) | | ||
| locale | <code>string</code> | | ||
<a name="HebrewDateEvent+render"></a> | ||
### hebrewDateEvent.render() ⇒ <code>string</code> | ||
**Kind**: instance method of [<code>HebrewDateEvent</code>](#HebrewDateEvent) | ||
<a name="Location"></a> | ||
@@ -960,2 +1021,60 @@ | ||
<a name="cities"></a> | ||
## cities : <code>object</code> | ||
Interface to lookup cities | ||
**Kind**: global namespace | ||
* [cities](#cities) : <code>object</code> | ||
* [.getCity(str)](#cities.getCity) ⇒ [<code>CityResult</code>](#CityResult) | ||
* [.init()](#cities.init) | ||
<a name="cities.getCity"></a> | ||
### cities.getCity(str) ⇒ [<code>CityResult</code>](#CityResult) | ||
Looks up a city | ||
**Kind**: static method of [<code>cities</code>](#cities) | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| str | <code>string</code> | city name (such as "San Francisco" or "Jerusalem") | | ||
<a name="cities.init"></a> | ||
### cities.init() | ||
Parses `geo.json`; must be called before `getCity()` | ||
**Kind**: static method of [<code>cities</code>](#cities) | ||
<a name="common$1"></a> | ||
## common$1 : <code>object</code> | ||
Common hebrew date routines | ||
**Kind**: global namespace | ||
<a name="dafyomi$2"></a> | ||
## dafyomi$2 : <code>object</code> | ||
Daf Yomi | ||
**Kind**: global namespace | ||
<a name="greg$1"></a> | ||
## greg$1 : <code>object</code> | ||
Gregorian date routines | ||
**Kind**: global namespace | ||
<a name="holidays$1"></a> | ||
## holidays$1 : <code>object</code> | ||
Lower-level holidays interface | ||
**Kind**: global namespace | ||
<a name="hebcal"></a> | ||
## hebcal : <code>object</code> | ||
Main interface to Hebcal | ||
**Kind**: global namespace | ||
<a name="months"></a> | ||
@@ -978,3 +1097,3 @@ | ||
| ELUL | <code>number</code> | <code>6</code> | Elul / אלול | | ||
| TISHREI | <code>number</code> | <code>7</code> | Tishrei / תִשְׁרֵי | | ||
| TISHREI | <code>number</code> | <code>7</code> | Tishrei / תִשְׁרֵי | | ||
| CHESHVAN | <code>number</code> | <code>8</code> | Cheshvan / חשון | | ||
@@ -1018,37 +1137,21 @@ | KISLEV | <code>number</code> | <code>9</code> | Kislev / כסלו | | ||
| CHAG | <code>number</code> | <code>CHAG</code> | Chag, yontiff, yom tov | | ||
| LIGHT_CANDLES | <code>number</code> | <code>LIGHT_CANDLES</code> | Light candles before sundown | | ||
| LIGHT_CANDLES | <code>number</code> | <code>LIGHT_CANDLES</code> | Light candles 18 minutes before sundown | | ||
| YOM_TOV_ENDS | <code>number</code> | <code>YOM_TOV_ENDS</code> | End of holiday (end of Yom Tov) | | ||
| CHUL_ONLY | <code>number</code> | <code>CHUL_ONLY</code> | | | ||
| IL_ONLY | <code>number</code> | <code>IL_ONLY</code> | | | ||
| LIGHT_CANDLES_TZEIS | <code>number</code> | <code>LIGHT_CANDLES_TZEIS</code> | | | ||
| CHANUKAH_CANDLES | <code>number</code> | <code>CHANUKAH_CANDLES</code> | | | ||
| ROSH_CHODESH | <code>number</code> | <code>ROSH_CHODESH</code> | | | ||
| MINOR_FAST | <code>number</code> | <code>MINOR_FAST</code> | | | ||
| SPECIAL_SHABBAT | <code>number</code> | <code>SPECIAL_SHABBAT</code> | | | ||
| PARSHA_HASHAVUA | <code>number</code> | <code>PARSHA_HASHAVUA</code> | | | ||
| DAF_YOMI | <code>number</code> | <code>DAF_YOMI</code> | | | ||
| OMER_COUNT | <code>number</code> | <code>OMER_COUNT</code> | | | ||
| MODERN_HOLIDAY | <code>number</code> | <code>MODERN_HOLIDAY</code> | | | ||
| MAJOR_FAST | <code>number</code> | <code>MAJOR_FAST</code> | | | ||
| SHABBAT_MEVARCHIM | <code>number</code> | <code>SHABBAT_MEVARCHIM</code> | | | ||
| MOLAD | <code>number</code> | <code>MOLAD</code> | | | ||
| USER_EVENT | <code>number</code> | <code>USER_EVENT</code> | | | ||
| CHUL_ONLY | <code>number</code> | <code>CHUL_ONLY</code> | Observed only in the Diaspora (chutz l'aretz) | | ||
| IL_ONLY | <code>number</code> | <code>IL_ONLY</code> | Observed only in Israel | | ||
| LIGHT_CANDLES_TZEIS | <code>number</code> | <code>LIGHT_CANDLES_TZEIS</code> | Light candles in the evening at Tzeit time (3 small stars) | | ||
| CHANUKAH_CANDLES | <code>number</code> | <code>CHANUKAH_CANDLES</code> | Candle-lighting for Chanukah | | ||
| ROSH_CHODESH | <code>number</code> | <code>ROSH_CHODESH</code> | Rosh Chodesh, beginning of a new Hebrew month | | ||
| MINOR_FAST | <code>number</code> | <code>MINOR_FAST</code> | Minor fasts like Tzom Tammuz, Ta'anit Esther, ... | | ||
| SPECIAL_SHABBAT | <code>number</code> | <code>SPECIAL_SHABBAT</code> | Shabbat Shekalim, Zachor, ... | | ||
| PARSHA_HASHAVUA | <code>number</code> | <code>PARSHA_HASHAVUA</code> | Weekly sedrot on Saturdays | | ||
| DAF_YOMI | <code>number</code> | <code>DAF_YOMI</code> | Daily page of Talmud | | ||
| OMER_COUNT | <code>number</code> | <code>OMER_COUNT</code> | Days of the Omer | | ||
| MODERN_HOLIDAY | <code>number</code> | <code>MODERN_HOLIDAY</code> | Yom HaShoah, Yom HaAtzma'ut, ... | | ||
| MAJOR_FAST | <code>number</code> | <code>MAJOR_FAST</code> | Yom Kippur and Tish'a B'Av | | ||
| SHABBAT_MEVARCHIM | <code>number</code> | <code>SHABBAT_MEVARCHIM</code> | On the Saturday before Rosh Chodesh | | ||
| MOLAD | <code>number</code> | <code>MOLAD</code> | Molad | | ||
| USER_EVENT | <code>number</code> | <code>USER_EVENT</code> | Yahrzeit or Hebrew Anniversary | | ||
| HEBREW_DATE | <code>number</code> | <code>HEBREW_DATE</code> | Daily Hebrew date ("11th of Sivan, 5780") | | ||
<a name="cities"></a> | ||
## cities | ||
Interface to lookup cities | ||
**Kind**: global constant | ||
<a name="cities.getCity"></a> | ||
### cities.getCity(str) ⇒ [<code>CityResult</code>](#CityResult) | ||
Looks up a city | ||
**Kind**: static method of [<code>cities</code>](#cities) | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| str | <code>string</code> | city name | | ||
<a name="hebLeapYear"></a> | ||
@@ -1419,2 +1522,66 @@ | ||
<a name="reformatTimeStr"></a> | ||
## reformatTimeStr(timeStr, suffix, options) ⇒ <code>string</code> | ||
Returns "8:13p" for US or "20:13" for any other locale/country | ||
**Kind**: global function | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| timeStr | <code>string</code> | original time like "20:30" | | ||
| suffix | <code>string</code> | "p" or "pm" or " P.M.". Add leading space if you want it | | ||
| options | <code>Object</code> | | | ||
<a name="makeAnchor"></a> | ||
## makeAnchor(s) ⇒ <code>string</code> | ||
**Kind**: global function | ||
| Param | Type | | ||
| --- | --- | | ||
| s | <code>string</code> | | ||
<a name="getHolidayBasename"></a> | ||
## getHolidayBasename(desc) ⇒ <code>string</code> | ||
**Kind**: global function | ||
| Param | Type | | ||
| --- | --- | | ||
| desc | <code>string</code> | | ||
<a name="getUrlInternal"></a> | ||
## getUrlInternal(e, hostname, dirs) ⇒ <code>string</code> | ||
**Kind**: global function | ||
| Param | Type | | ||
| --- | --- | | ||
| e | [<code>Event</code>](#Event) | | ||
| hostname | <code>string</code> | | ||
| dirs | <code>Array.<string></code> | | ||
<a name="getShortUrl"></a> | ||
## getShortUrl(e) ⇒ <code>string</code> | ||
Gets a short redirector URL for hebcal.com | ||
**Kind**: global function | ||
| Param | Type | | ||
| --- | --- | | ||
| e | [<code>Event</code>](#Event) | | ||
<a name="getEventUrl"></a> | ||
## getEventUrl(e) ⇒ <code>string</code> | ||
Gets a regular (long, non-redirector) URL for hebcal.com | ||
**Kind**: global function | ||
| Param | Type | | ||
| --- | --- | | ||
| e | [<code>Event</code>](#Event) | | ||
<a name="formatTime"></a> | ||
@@ -1477,2 +1644,13 @@ | ||
<a name="getAbs"></a> | ||
## getAbs(d) ⇒ <code>number</code> | ||
Gets the Julian absolute days for a number, Date, or HDate | ||
**Kind**: global function | ||
| Param | Type | | ||
| --- | --- | | ||
| d | <code>Date</code> \| [<code>HDate</code>](#HDate) \| <code>number</code> | | ||
<a name="getStartAndEnd"></a> | ||
@@ -1509,5 +1687,5 @@ | ||
<a name="hebcalEvents"></a> | ||
<a name="hebrewCalendar"></a> | ||
## hebcalEvents(options) ⇒ [<code>Array.<Event></code>](#Event) | ||
## hebrewCalendar(options) ⇒ [<code>Array.<Event></code>](#Event) | ||
Generates a list of holidays | ||
@@ -1597,2 +1775,4 @@ | ||
| numYears | <code>number</code> | generate calendar for multiple years (default 1) | | ||
| start | <code>Date</code> \| [<code>HDate</code>](#HDate) \| <code>number</code> | use specific start date (requires end date) | | ||
| end | <code>Date</code> \| [<code>HDate</code>](#HDate) \| <code>number</code> | use specific end date (requires start date) | | ||
| candlelighting | <code>boolean</code> | calculate candle-lighting and havdalah times | | ||
@@ -1606,3 +1786,4 @@ | candleLightingMins | <code>number</code> | minutes before sundown to light candles (default 18) | | ||
| noModern | <code>boolean</code> | suppress modern holidays | | ||
| noRoshChodesh | <code>boolean</code> | suppress Rosh Chodesh & Shabbat Mevarchim | | ||
| noRoshChodesh | <code>boolean</code> | suppress Rosh Chodesh | | ||
| shabbatMevarchim | <code>boolean</code> | add Shabbat Mevarchim | | ||
| noSpecialShabbat | <code>boolean</code> | suppress Special Shabbat | | ||
@@ -1616,2 +1797,3 @@ | noHolidays | <code>boolean</code> | suppress regular holidays | | ||
| hour12 | <code>boolean</code> | use 12-hour time (1-12) instead of default 24-hour time (0-23) | | ||
| addHebrewDates | <code>boolean</code> | print the Hebrew date for the entire date range | | ||
| addHebrewDatesForEvents | <code>boolean</code> | print the Hebrew date for dates with some events | |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
526168
7603
1784