@hebcal/core 5.4.8 → 5.4.10
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/README.md +3 -3735
- package/dist/CalOptions.d.ts +2 -1
- package/dist/DailyLearning.d.ts +3 -6
- package/dist/HebrewDateEvent.d.ts +4 -7
- package/dist/HolidayEvent.d.ts +9 -23
- package/dist/MevarchimChodeshEvent.d.ts +5 -8
- package/dist/ParshaEvent.d.ts +2 -9
- package/dist/TimedEvent.d.ts +5 -12
- package/dist/YomKippurKatanEvent.d.ts +4 -8
- package/dist/bundle.js +1123 -878
- package/dist/bundle.js.map +1 -0
- package/dist/bundle.min.js +3 -2
- package/dist/bundle.min.js.map +1 -0
- package/dist/event.d.ts +61 -51
- package/dist/hallel.d.ts +0 -3
- package/dist/hebcal.d.ts +15 -36
- package/dist/index.cjs +1172 -912
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.mjs +1172 -912
- package/dist/index.mjs.map +1 -0
- package/dist/location.d.ts +14 -28
- package/dist/modern.d.ts +2 -4
- package/dist/molad.d.ts +13 -18
- package/dist/omer.d.ts +6 -14
- package/dist/pkgVersion.d.ts +1 -1
- package/dist/reformatTimeStr.d.ts +3 -4
- package/dist/sedra.d.ts +9 -19
- package/dist/staticHolidays.d.ts +74 -74
- package/dist/zmanim.d.ts +19 -60
- package/package.json +13 -12
package/dist/event.d.ts
CHANGED
|
@@ -1,95 +1,115 @@
|
|
|
1
1
|
import { HDate } from '@hebcal/hdate';
|
|
2
2
|
import './locale';
|
|
3
3
|
/**
|
|
4
|
-
* Holiday flags for Event
|
|
4
|
+
* Holiday flags for Event. These flags are typically
|
|
5
|
+
* combined using bitwise arithmetic to form a mask.
|
|
5
6
|
* @readonly
|
|
6
7
|
* @enum {number}
|
|
7
8
|
*/
|
|
8
9
|
export declare const flags: {
|
|
9
10
|
/** Chag, yontiff, yom tov */
|
|
10
|
-
CHAG:
|
|
11
|
+
readonly CHAG: 1;
|
|
11
12
|
/** Light candles 18 minutes before sundown */
|
|
12
|
-
LIGHT_CANDLES:
|
|
13
|
+
readonly LIGHT_CANDLES: 2;
|
|
13
14
|
/** End of holiday (end of Yom Tov) */
|
|
14
|
-
YOM_TOV_ENDS:
|
|
15
|
+
readonly YOM_TOV_ENDS: 4;
|
|
15
16
|
/** Observed only in the Diaspora (chutz l'aretz) */
|
|
16
|
-
CHUL_ONLY:
|
|
17
|
+
readonly CHUL_ONLY: 8;
|
|
17
18
|
/** Observed only in Israel */
|
|
18
|
-
IL_ONLY:
|
|
19
|
+
readonly IL_ONLY: 16;
|
|
19
20
|
/** Light candles in the evening at Tzeit time (3 small stars) */
|
|
20
|
-
LIGHT_CANDLES_TZEIS:
|
|
21
|
+
readonly LIGHT_CANDLES_TZEIS: 32;
|
|
21
22
|
/** Candle-lighting for Chanukah */
|
|
22
|
-
CHANUKAH_CANDLES:
|
|
23
|
+
readonly CHANUKAH_CANDLES: 64;
|
|
23
24
|
/** Rosh Chodesh, beginning of a new Hebrew month */
|
|
24
|
-
ROSH_CHODESH:
|
|
25
|
+
readonly ROSH_CHODESH: 128;
|
|
25
26
|
/** Minor fasts like Tzom Tammuz, Ta'anit Esther, ... */
|
|
26
|
-
MINOR_FAST:
|
|
27
|
+
readonly MINOR_FAST: 256;
|
|
27
28
|
/** Shabbat Shekalim, Zachor, ... */
|
|
28
|
-
SPECIAL_SHABBAT:
|
|
29
|
+
readonly SPECIAL_SHABBAT: 512;
|
|
29
30
|
/** Weekly sedrot on Saturdays */
|
|
30
|
-
PARSHA_HASHAVUA:
|
|
31
|
+
readonly PARSHA_HASHAVUA: 1024;
|
|
31
32
|
/** Daily page of Talmud (Bavli) */
|
|
32
|
-
DAF_YOMI:
|
|
33
|
+
readonly DAF_YOMI: 2048;
|
|
33
34
|
/** Days of the Omer */
|
|
34
|
-
OMER_COUNT:
|
|
35
|
+
readonly OMER_COUNT: 4096;
|
|
35
36
|
/** Yom HaShoah, Yom HaAtzma'ut, ... */
|
|
36
|
-
MODERN_HOLIDAY:
|
|
37
|
+
readonly MODERN_HOLIDAY: 8192;
|
|
37
38
|
/** Yom Kippur and Tish'a B'Av */
|
|
38
|
-
MAJOR_FAST:
|
|
39
|
+
readonly MAJOR_FAST: 16384;
|
|
39
40
|
/** On the Saturday before Rosh Chodesh */
|
|
40
|
-
SHABBAT_MEVARCHIM:
|
|
41
|
+
readonly SHABBAT_MEVARCHIM: 32768;
|
|
41
42
|
/** Molad */
|
|
42
|
-
MOLAD:
|
|
43
|
+
readonly MOLAD: 65536;
|
|
43
44
|
/** Yahrzeit or Hebrew Anniversary */
|
|
44
|
-
USER_EVENT:
|
|
45
|
+
readonly USER_EVENT: 131072;
|
|
45
46
|
/** Daily Hebrew date ("11th of Sivan, 5780") */
|
|
46
|
-
HEBREW_DATE:
|
|
47
|
+
readonly HEBREW_DATE: 262144;
|
|
47
48
|
/** A holiday that's not major, modern, rosh chodesh, or a fast day */
|
|
48
|
-
MINOR_HOLIDAY:
|
|
49
|
+
readonly MINOR_HOLIDAY: 524288;
|
|
49
50
|
/** Evening before a major or minor holiday */
|
|
50
|
-
EREV:
|
|
51
|
+
readonly EREV: 1048576;
|
|
51
52
|
/** Chol haMoed, intermediate days of Pesach or Sukkot */
|
|
52
|
-
CHOL_HAMOED:
|
|
53
|
+
readonly CHOL_HAMOED: 2097152;
|
|
53
54
|
/** Mishna Yomi */
|
|
54
|
-
MISHNA_YOMI:
|
|
55
|
+
readonly MISHNA_YOMI: 4194304;
|
|
55
56
|
/** Yom Kippur Katan, minor day of atonement on the day preceeding each Rosh Chodesh */
|
|
56
|
-
YOM_KIPPUR_KATAN:
|
|
57
|
+
readonly YOM_KIPPUR_KATAN: 8388608;
|
|
57
58
|
/** Daily page of Jerusalem Talmud (Yerushalmi) */
|
|
58
|
-
YERUSHALMI_YOMI:
|
|
59
|
+
readonly YERUSHALMI_YOMI: 16777216;
|
|
59
60
|
/** Nach Yomi */
|
|
60
|
-
NACH_YOMI:
|
|
61
|
+
readonly NACH_YOMI: 33554432;
|
|
61
62
|
/** Daily Learning */
|
|
62
|
-
DAILY_LEARNING:
|
|
63
|
+
readonly DAILY_LEARNING: 67108864;
|
|
63
64
|
};
|
|
64
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Represents an Event with a title, date, and flags.
|
|
67
|
+
*
|
|
68
|
+
* Events are used to represent holidays, candle-lighting times,
|
|
69
|
+
* Torah readings, and more.
|
|
70
|
+
*
|
|
71
|
+
* To get the title of the event a language other than English
|
|
72
|
+
* with Sephardic transliterations, use the `render()` method.
|
|
73
|
+
*/
|
|
65
74
|
export declare class Event {
|
|
75
|
+
/** Hebrew date of this event */
|
|
66
76
|
readonly date: HDate;
|
|
77
|
+
/**
|
|
78
|
+
* Untranslated title of this event. Note that these description
|
|
79
|
+
* strings are always in English and will remain stable across releases.
|
|
80
|
+
* To get the title of the event in another language, use the
|
|
81
|
+
* `render()` method.
|
|
82
|
+
*/
|
|
67
83
|
readonly desc: string;
|
|
84
|
+
/** Bitmask of optional event flags. See {@link flags} */
|
|
68
85
|
readonly mask: number;
|
|
86
|
+
/** Optional emoji character such as ✡️, 🕯️, 🕎, 🕍, 🌒 */
|
|
69
87
|
emoji?: string;
|
|
88
|
+
/** Optional longer description or memo text */
|
|
70
89
|
memo?: string;
|
|
90
|
+
/** Alarms are used by iCalendar feeds */
|
|
71
91
|
alarm?: Date | string | boolean;
|
|
72
92
|
/**
|
|
73
93
|
* Constructs Event
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
77
|
-
* @param
|
|
94
|
+
* @param date Hebrew date event occurs
|
|
95
|
+
* @param desc Description (not translated)
|
|
96
|
+
* @param [mask=0] optional bitmask of holiday flags (see {@link flags})
|
|
97
|
+
* @param [attrs={}] optional additional attributes (e.g. `eventTimeStr`, `cholHaMoedDay`)
|
|
78
98
|
*/
|
|
79
99
|
constructor(date: HDate, desc: string, mask?: number, attrs?: object);
|
|
80
100
|
/**
|
|
81
101
|
* Hebrew date of this event
|
|
82
|
-
* @return {HDate}
|
|
83
102
|
*/
|
|
84
103
|
getDate(): HDate;
|
|
85
104
|
/**
|
|
86
|
-
* Untranslated
|
|
87
|
-
*
|
|
105
|
+
* Untranslated title of this event. Note that these description
|
|
106
|
+
* strings are always in English and will remain stable across releases.
|
|
107
|
+
* To get the title of the event in another language, use the
|
|
108
|
+
* `render()` method.
|
|
88
109
|
*/
|
|
89
110
|
getDesc(): string;
|
|
90
111
|
/**
|
|
91
112
|
* Bitmask of optional event flags. See {@link flags}
|
|
92
|
-
* @return {number}
|
|
93
113
|
*/
|
|
94
114
|
getFlags(): number;
|
|
95
115
|
/**
|
|
@@ -99,35 +119,30 @@ export declare class Event {
|
|
|
99
119
|
* ev.render('en'); // 'Shavuot'
|
|
100
120
|
* ev.render('he'); // 'שָׁבוּעוֹת'
|
|
101
121
|
* ev.render('ashkenazi'); // 'Shavuos'
|
|
102
|
-
* @param
|
|
103
|
-
* @return {string}
|
|
122
|
+
* @param [locale] Optional locale name (defaults to active locale).
|
|
104
123
|
*/
|
|
105
124
|
render(locale?: string): string;
|
|
106
125
|
/**
|
|
107
126
|
* Returns a brief (translated) description of this event.
|
|
108
127
|
* For most events, this is the same as render(). For some events, it procudes
|
|
109
128
|
* a shorter text (e.g. without a time or added description).
|
|
110
|
-
* @param
|
|
111
|
-
* @return {string}
|
|
129
|
+
* @param [locale] Optional locale name (defaults to active locale).
|
|
112
130
|
*/
|
|
113
131
|
renderBrief(locale?: string): string;
|
|
114
132
|
/**
|
|
115
133
|
* Optional holiday-specific Emoji or `null`.
|
|
116
|
-
* @return {string | null}
|
|
117
134
|
*/
|
|
118
135
|
getEmoji(): string | null;
|
|
119
136
|
/**
|
|
120
137
|
* Returns a simplified (untranslated) description for this event. For example,
|
|
121
|
-
* the
|
|
138
|
+
* the `HolidayEvent` class supports
|
|
122
139
|
* "Erev Pesach" => "Pesach", and "Sukkot III (CH''M)" => "Sukkot".
|
|
123
140
|
* For many holidays the basename and the event description are the same.
|
|
124
|
-
* @return {string}
|
|
125
141
|
*/
|
|
126
142
|
basename(): string;
|
|
127
143
|
/**
|
|
128
144
|
* Returns a URL to hebcal.com or sefaria.org for more detail on the event.
|
|
129
145
|
* Returns `undefined` for events with no detail page.
|
|
130
|
-
* @return {string | undefined}
|
|
131
146
|
*/
|
|
132
147
|
url(): string | undefined;
|
|
133
148
|
/**
|
|
@@ -137,7 +152,6 @@ export declare class Event {
|
|
|
137
152
|
* ev1.observedInIsrael(); // false
|
|
138
153
|
* const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
|
|
139
154
|
* ev2.observedInIsrael(); // true
|
|
140
|
-
* @return {boolean}
|
|
141
155
|
*/
|
|
142
156
|
observedInIsrael(): boolean;
|
|
143
157
|
/**
|
|
@@ -147,7 +161,6 @@ export declare class Event {
|
|
|
147
161
|
* ev1.observedInDiaspora(); // true
|
|
148
162
|
* const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
|
|
149
163
|
* ev2.observedInDiaspora(); // true
|
|
150
|
-
* @return {boolean}
|
|
151
164
|
*/
|
|
152
165
|
observedInDiaspora(): boolean;
|
|
153
166
|
/**
|
|
@@ -159,18 +172,15 @@ export declare class Event {
|
|
|
159
172
|
* const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
|
|
160
173
|
* ev2.observedIn(false); // true
|
|
161
174
|
* ev2.observedIn(true); // true
|
|
162
|
-
* @param
|
|
163
|
-
* @return {boolean}
|
|
175
|
+
* @param il
|
|
164
176
|
*/
|
|
165
177
|
observedIn(il: boolean): boolean;
|
|
166
178
|
/**
|
|
167
179
|
* Makes a clone of this Event object
|
|
168
|
-
* @return {Event}
|
|
169
180
|
*/
|
|
170
181
|
clone(): Event;
|
|
171
182
|
/**
|
|
172
183
|
* Returns a list of event categories
|
|
173
|
-
* @return {string[]}
|
|
174
184
|
*/
|
|
175
185
|
getCategories(): string[];
|
|
176
186
|
}
|
package/dist/hallel.d.ts
CHANGED
package/dist/hebcal.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { TachanunResult } from './tachanun';
|
|
|
13
13
|
* Event names can be rendered in several languges using the `locale` option.
|
|
14
14
|
*/
|
|
15
15
|
export declare class HebrewCalendar {
|
|
16
|
+
private constructor();
|
|
16
17
|
/**
|
|
17
18
|
* Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.
|
|
18
19
|
*
|
|
@@ -119,8 +120,6 @@ export declare class HebrewCalendar {
|
|
|
119
120
|
* const date = hd.greg();
|
|
120
121
|
* console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());
|
|
121
122
|
* }
|
|
122
|
-
* @param {CalOptions} [options={}]
|
|
123
|
-
* @return {Event[]}
|
|
124
123
|
*/
|
|
125
124
|
static calendar(options?: CalOptions): Event[];
|
|
126
125
|
/**
|
|
@@ -145,9 +144,9 @@ export declare class HebrewCalendar {
|
|
|
145
144
|
* const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
|
|
146
145
|
* const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'
|
|
147
146
|
* console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'
|
|
148
|
-
* @param
|
|
149
|
-
* @param
|
|
150
|
-
* @
|
|
147
|
+
* @param hyear Hebrew year
|
|
148
|
+
* @param gdate Gregorian or Hebrew date of event
|
|
149
|
+
* @returns anniversary occurring in `hyear`
|
|
151
150
|
*/
|
|
152
151
|
static getBirthdayOrAnniversary(hyear: number, gdate: Date | HDate): HDate | undefined;
|
|
153
152
|
/**
|
|
@@ -180,39 +179,32 @@ export declare class HebrewCalendar {
|
|
|
180
179
|
* const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
|
|
181
180
|
* const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\'vat 5780'
|
|
182
181
|
* console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'
|
|
183
|
-
* @param
|
|
184
|
-
* @param
|
|
185
|
-
* @
|
|
182
|
+
* @param hyear Hebrew year
|
|
183
|
+
* @param gdate Gregorian or Hebrew date of death
|
|
184
|
+
* @returns anniversary occurring in hyear
|
|
186
185
|
*/
|
|
187
186
|
static getYahrzeit(hyear: number, gdate: Date | HDate): HDate | undefined;
|
|
188
187
|
/**
|
|
189
188
|
* Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
|
|
190
189
|
* `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`
|
|
191
190
|
* or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.
|
|
192
|
-
* @
|
|
193
|
-
* @param {number} year Hebrew year
|
|
194
|
-
* @return {HolidayYearMap}
|
|
191
|
+
* @param year Hebrew year
|
|
195
192
|
*/
|
|
196
193
|
static getHolidaysForYear(year: number): HolidayYearMap;
|
|
197
194
|
/**
|
|
198
195
|
* Returns an array of holidays for the year
|
|
199
|
-
* @param
|
|
200
|
-
* @param
|
|
201
|
-
* @return {HolidayEvent[]}
|
|
196
|
+
* @param year Hebrew year
|
|
197
|
+
* @param il use the Israeli schedule for holidays
|
|
202
198
|
*/
|
|
203
199
|
static getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[];
|
|
204
200
|
/**
|
|
205
201
|
* Returns an array of Events on this date (or `undefined` if no events)
|
|
206
|
-
* @param
|
|
207
|
-
* @param
|
|
208
|
-
* @return {HolidayEvent[] | undefined}
|
|
202
|
+
* @param date Hebrew Date, Gregorian date, or absolute R.D. day number
|
|
203
|
+
* @param [il] use the Israeli schedule for holidays
|
|
209
204
|
*/
|
|
210
205
|
static getHolidaysOnDate(date: HDate | Date | number, il?: boolean): HolidayEvent[] | undefined;
|
|
211
206
|
/**
|
|
212
207
|
* Eruv Tavshilin
|
|
213
|
-
* @param {Date | HDate} date
|
|
214
|
-
* @param {boolean} il
|
|
215
|
-
* @return {boolean}
|
|
216
208
|
*/
|
|
217
209
|
static eruvTavshilin(date: Date | HDate, il: boolean): boolean;
|
|
218
210
|
/**
|
|
@@ -221,21 +213,15 @@ export declare class HebrewCalendar {
|
|
|
221
213
|
* locale.
|
|
222
214
|
* If `options.hour12` is `false`, locale is ignored and always returns 24-hour time.
|
|
223
215
|
* If `options.hour12` is `true`, locale is ignored and always returns 12-hour time.
|
|
224
|
-
* @param
|
|
225
|
-
* @param
|
|
226
|
-
* @param
|
|
227
|
-
* @return {string}
|
|
216
|
+
* @param timeStr - original time like "20:30"
|
|
217
|
+
* @param suffix - "p" or "pm" or " P.M.". Add leading space if you want it
|
|
218
|
+
* @param options
|
|
228
219
|
*/
|
|
229
220
|
static reformatTimeStr(timeStr: string, suffix: string, options: CalOptions): string;
|
|
230
|
-
/** @return {string} */
|
|
231
221
|
static version(): string;
|
|
232
222
|
/**
|
|
233
223
|
* Convenience function to create an instance of `Sedra` or reuse a previously
|
|
234
224
|
* created and cached instance.
|
|
235
|
-
* @function
|
|
236
|
-
* @param {number} hyear
|
|
237
|
-
* @param {boolean} il
|
|
238
|
-
* @return {Sedra}
|
|
239
225
|
*/
|
|
240
226
|
static getSedra(hyear: number, il: boolean): Sedra;
|
|
241
227
|
/**
|
|
@@ -251,10 +237,6 @@ export declare class HebrewCalendar {
|
|
|
251
237
|
* 0 - No Hallel
|
|
252
238
|
* 1 - Half Hallel
|
|
253
239
|
* 2 - Whole Hallel
|
|
254
|
-
*
|
|
255
|
-
* @param {HDate} hdate
|
|
256
|
-
* @param {boolean} il
|
|
257
|
-
* @return {number}
|
|
258
240
|
*/
|
|
259
241
|
static hallel(hdate: HDate, il: boolean): number;
|
|
260
242
|
/**
|
|
@@ -272,9 +254,6 @@ export declare class HebrewCalendar {
|
|
|
272
254
|
* Tachanun is not said at Mincha on days before it is not said at Shacharit.
|
|
273
255
|
*
|
|
274
256
|
* Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.
|
|
275
|
-
* @param {HDate} hdate
|
|
276
|
-
* @param {boolean} il
|
|
277
|
-
* @return {TachanunResult}
|
|
278
257
|
*/
|
|
279
258
|
static tachanun(hdate: HDate, il: boolean): TachanunResult;
|
|
280
259
|
}
|