@hebcal/core 6.8.1 → 6.9.0
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 +262 -4
- package/dist/bundle.js +1401 -943
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +18 -17
- package/dist/bundle.min.js.map +1 -1
- package/dist/esm/CalOptions.d.ts +11 -1
- package/dist/esm/DailyLearning.d.ts +4 -4
- package/dist/esm/DailyLearning.js +5 -5
- package/dist/esm/DailyLearning.js.map +1 -1
- package/dist/esm/HebrewDateEvent.js +1 -1
- package/dist/esm/HolidayEvent.d.ts +7 -2
- package/dist/esm/HolidayEvent.js +8 -3
- package/dist/esm/HolidayEvent.js.map +1 -1
- package/dist/esm/MevarchimChodeshEvent.d.ts +2 -1
- package/dist/esm/MevarchimChodeshEvent.js +3 -2
- package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
- package/dist/esm/ParshaEvent.d.ts +13 -0
- package/dist/esm/ParshaEvent.js +14 -1
- package/dist/esm/ParshaEvent.js.map +1 -1
- package/dist/esm/TimedEvent.d.ts +12 -4
- package/dist/esm/TimedEvent.js +13 -5
- package/dist/esm/TimedEvent.js.map +1 -1
- package/dist/esm/YomKippurKatanEvent.d.ts +2 -1
- package/dist/esm/YomKippurKatanEvent.js +3 -2
- package/dist/esm/YomKippurKatanEvent.js.map +1 -1
- package/dist/esm/ashkenazi.po.js +1 -1
- package/dist/esm/calendar.d.ts +17 -7
- package/dist/esm/calendar.js +23 -10
- package/dist/esm/calendar.js.map +1 -1
- package/dist/esm/candles.d.ts +19 -1
- package/dist/esm/candles.js +20 -2
- package/dist/esm/candles.js.map +1 -1
- package/dist/esm/cities.json.js +1 -1
- package/dist/esm/event.d.ts +2 -4
- package/dist/esm/event.js +3 -5
- package/dist/esm/event.js.map +1 -1
- package/dist/esm/getStartAndEnd.js +1 -1
- package/dist/esm/hallel.js +1 -1
- package/dist/esm/he-x-NoNikud.po.js +1 -1
- package/dist/esm/he.po.js +2 -2
- package/dist/esm/he.po.js.map +1 -1
- package/dist/esm/hebcal.d.ts +31 -96
- package/dist/esm/hebcal.js +34 -107
- package/dist/esm/hebcal.js.map +1 -1
- package/dist/esm/holidays.d.ts +8 -1
- package/dist/esm/holidays.js +2 -2
- package/dist/esm/holidays.js.map +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isAssurBemlacha.js +6 -3
- package/dist/esm/isAssurBemlacha.js.map +1 -1
- package/dist/esm/isAveilut.js +1 -1
- package/dist/esm/isFastDay.d.ts +1 -1
- package/dist/esm/isFastDay.js +2 -2
- package/dist/esm/isFastDay.js.map +1 -1
- package/dist/esm/locale.js +1 -1
- package/dist/esm/location.d.ts +37 -9
- package/dist/esm/location.js +38 -10
- package/dist/esm/location.js.map +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/molad.d.ts +26 -20
- package/dist/esm/molad.js +27 -21
- package/dist/esm/molad.js.map +1 -1
- package/dist/esm/moladBase.d.ts +11 -0
- package/dist/esm/moladBase.js +12 -1
- package/dist/esm/moladBase.js.map +1 -1
- package/dist/esm/moladDate.d.ts +10 -6
- package/dist/esm/moladDate.js +25 -18
- package/dist/esm/moladDate.js.map +1 -1
- package/dist/esm/omer.d.ts +19 -3
- package/dist/esm/omer.js +20 -4
- package/dist/esm/omer.js.map +1 -1
- package/dist/esm/parshaName.js +1 -1
- package/dist/esm/parshaYear.d.ts +2 -2
- package/dist/esm/parshaYear.js +3 -3
- package/dist/esm/parshaYear.js.map +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.d.ts +14 -2
- package/dist/esm/reformatTimeStr.js +15 -3
- package/dist/esm/reformatTimeStr.js.map +1 -1
- package/dist/esm/sedra.d.ts +44 -18
- package/dist/esm/sedra.js +39 -17
- package/dist/esm/sedra.js.map +1 -1
- package/dist/esm/sefira.json.js +1 -1
- package/dist/esm/staticHolidays.d.ts +0 -2
- package/dist/esm/staticHolidays.js +1 -3
- package/dist/esm/staticHolidays.js.map +1 -1
- package/dist/esm/string.js +1 -1
- package/dist/esm/tachanun.js +1 -1
- package/dist/esm/zmanim.d.ts +177 -142
- package/dist/esm/zmanim.js +183 -148
- package/dist/esm/zmanim.js.map +1 -1
- package/package.json +9 -10
- package/po/he.po +4 -2
package/dist/esm/hebcal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
2
|
-
import {
|
|
1
|
+
/*! @hebcal/core v6.9.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
|
+
import { birthdayOrAnniversary, yahrzeit, HDate } from '@hebcal/hdate';
|
|
3
3
|
import './locale.js';
|
|
4
4
|
import { version } from './pkgVersion.js';
|
|
5
5
|
import { flags } from './event.js';
|
|
@@ -45,92 +45,12 @@ class HebrewCalendar {
|
|
|
45
45
|
* a description, flags and optional attributes.
|
|
46
46
|
* If given no options, returns holidays for the Diaspora for the current Gregorian year.
|
|
47
47
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* * `options.numYears` - generate calendar for multiple years (default 1, maximum 2000)
|
|
52
|
-
* * `options.month` - Gregorian or Hebrew month (to filter results to a single month)
|
|
53
|
-
*
|
|
54
|
-
* Alternatively, specify start and end days with `Date` or {@link HDate} instances:
|
|
55
|
-
* * `options.start` - use specific start date (requires `end` date)
|
|
56
|
-
* * `options.end` - use specific end date (requires `start` date)
|
|
57
|
-
*
|
|
58
|
-
* Unless `options.noHolidays == true`, default holidays include:
|
|
59
|
-
* * Major holidays - Rosh Hashana, Yom Kippur, Pesach, Sukkot, etc.
|
|
60
|
-
* * Minor holidays - Purim, Chanukah, Tu BiShvat, Lag BaOmer, etc.
|
|
61
|
-
* * Minor fasts - Ta'anit Esther, Tzom Gedaliah, etc. (unless `options.noMinorFast`)
|
|
62
|
-
* * Special Shabbatot - Shabbat Shekalim, Zachor, etc. (unless `options.noSpecialShabbat`)
|
|
63
|
-
* * Modern Holidays - Yom HaShoah, Yom HaAtzma'ut, etc. (unless `options.noModern`)
|
|
64
|
-
* * Rosh Chodesh (unless `options.noRoshChodesh`)
|
|
65
|
-
*
|
|
66
|
-
* Holiday and Torah reading schedules differ between Israel and the Disapora.
|
|
67
|
-
* Set `options.il=true` to use the Israeli schedule.
|
|
68
|
-
*
|
|
69
|
-
* Additional non-default event types can be specified:
|
|
70
|
-
* * Parashat HaShavua - weekly Torah Reading on Saturdays (`options.sedrot`)
|
|
71
|
-
* * Counting of the Omer (`options.omer`)
|
|
72
|
-
* * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
|
|
73
|
-
* * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
|
|
74
|
-
* * Yom Kippur Katan (`options.yomKippurKatan`)
|
|
75
|
-
* * Yizkor (`options.yizkor`)
|
|
76
|
-
*
|
|
77
|
-
* Daily Study of texts are supported by the
|
|
78
|
-
* {@link https://github.com/hebcal/hebcal-learning @hebcal/learning} package,
|
|
79
|
-
* for example:
|
|
80
|
-
* * Babylonian Talmud Daf Yomi (`options.dailyLearning.dafYomi`)
|
|
81
|
-
* * Jerusalem Talmud (Yerushalmi) Yomi (`options.dailyLearning.yerushalmi`)
|
|
82
|
-
* * Mishna Yomi (`options.dailyLearning.mishnaYomi`)
|
|
83
|
-
* * Nach Yomi (`options.dailyLearning.nachYomi`)
|
|
84
|
-
*
|
|
85
|
-
* Candle-lighting and Havdalah times are approximated using latitude and longitude
|
|
86
|
-
* specified by the {@link Location} class. The `Location` class contains a small
|
|
87
|
-
* database of cities with their associated geographic information and time-zone information.
|
|
88
|
-
* If you ever have any doubts about Hebcal's times, consult your local halachic authority.
|
|
89
|
-
* If you enter geographic coordinates above the arctic circle or antarctic circle,
|
|
90
|
-
* the times are guaranteed to be wrong.
|
|
91
|
-
*
|
|
92
|
-
* To add candle-lighting options, set `options.candlelighting=true` and set
|
|
93
|
-
* `options.location` to an instance of `Location`. By default, candle lighting
|
|
94
|
-
* time is 18 minutes before sundown (40 minutes for Jerusalem,
|
|
95
|
-
* 30 minutes for Haifa and Zikhron Ya'akov) and Havdalah is
|
|
96
|
-
* calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars
|
|
97
|
-
* are observable in the night time sky with the naked eye). The default Havdalah
|
|
98
|
-
* option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.
|
|
99
|
-
* These defaults can be changed using these options:
|
|
100
|
-
* * `options.candleLightingMins` - minutes before sundown to light candles
|
|
101
|
-
* * `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).
|
|
102
|
-
* Havdalah times are suppressed when `options.havdalahMins=0`.
|
|
103
|
-
* * `options.havdalahDeg` - degrees for solar depression for Havdalah.
|
|
104
|
-
* Default is 8.5 degrees for 3 small stars. Use 7.083 degrees for 3 medium-sized stars.
|
|
105
|
-
* Havdalah times are suppressed when `options.havdalahDeg=0`.
|
|
106
|
-
*
|
|
107
|
-
* If both `options.candlelighting=true` and `options.location` is specified,
|
|
108
|
-
* Chanukah candle-lighting times and minor fast start/end times will also be generated.
|
|
109
|
-
* Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before
|
|
110
|
-
* the sun is 7.083° below the horizon in the evening)
|
|
111
|
-
* on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on
|
|
112
|
-
* Saturday night (see above).
|
|
113
|
-
*
|
|
114
|
-
* Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning) and
|
|
115
|
-
* end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon
|
|
116
|
-
* in the evening).
|
|
117
|
-
*
|
|
118
|
-
* Two options also exist for generating an Event with the Hebrew date:
|
|
119
|
-
* * `options.addHebrewDates` - print the Hebrew date for the entire date range
|
|
120
|
-
* * `options.addHebrewDatesForEvents` - print the Hebrew date for dates with some events
|
|
121
|
-
*
|
|
122
|
-
* Lastly, translation and transliteration of event titles is controlled by
|
|
123
|
-
* `options.locale` and the {@link Locale} API.
|
|
124
|
-
* `@hebcal/core` supports three locales by default:
|
|
125
|
-
* * `en` - default, Sephardic transliterations (e.g. "Shabbat")
|
|
126
|
-
* * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
127
|
-
* * `he` - Hebrew (e.g. "שַׁבָּת")
|
|
128
|
-
*
|
|
129
|
-
* Additional locales (such as `ru` or `fr`) are supported by the
|
|
130
|
-
* {@link https://github.com/hebcal/hebcal-locales @hebcal/locales} package
|
|
48
|
+
* This is a convenience wrapper around the standalone {@link calendar} function.
|
|
49
|
+
* See {@link calendar} for the complete list of supported options, the
|
|
50
|
+
* candle-lighting and Havdalah defaults, and notes on locales.
|
|
131
51
|
*
|
|
132
52
|
* @example
|
|
133
|
-
* import {HebrewCalendar,
|
|
53
|
+
* import {HebrewCalendar, Location} from '@hebcal/core';
|
|
134
54
|
* const options: CalOptions = {
|
|
135
55
|
* year: 1981,
|
|
136
56
|
* isHebrewYear: false,
|
|
@@ -151,8 +71,12 @@ class HebrewCalendar {
|
|
|
151
71
|
}
|
|
152
72
|
/**
|
|
153
73
|
* Calculates a birthday or anniversary (non-yahrzeit).
|
|
154
|
-
* `hyear`
|
|
155
|
-
*
|
|
74
|
+
* Returns `undefined` when `hyear` precedes the original year of `gdate`.
|
|
75
|
+
*
|
|
76
|
+
* When `hyear` is the original year, the original date is returned unchanged —
|
|
77
|
+
* a "0th birthday" is a meaningful thing to ask for. This differs from
|
|
78
|
+
* {@link getYahrzeit}, which returns `undefined` for the original year,
|
|
79
|
+
* because a yahrzeit only has meaning from the first anniversary onward.
|
|
156
80
|
*
|
|
157
81
|
* Hebcal uses the algorithm defined in "Calendrical Calculations"
|
|
158
82
|
* by Edward M. Reingold and Nachum Dershowitz.
|
|
@@ -176,11 +100,7 @@ class HebrewCalendar {
|
|
|
176
100
|
* @returns anniversary occurring in `hyear`
|
|
177
101
|
*/
|
|
178
102
|
static getBirthdayOrAnniversary(hyear, gdate) {
|
|
179
|
-
|
|
180
|
-
if (dt === undefined) {
|
|
181
|
-
return dt;
|
|
182
|
-
}
|
|
183
|
-
return new HDate(dt);
|
|
103
|
+
return birthdayOrAnniversary(hyear, gdate);
|
|
184
104
|
}
|
|
185
105
|
/**
|
|
186
106
|
* Calculates yahrzeit.
|
|
@@ -217,11 +137,7 @@ class HebrewCalendar {
|
|
|
217
137
|
* @returns anniversary occurring in hyear
|
|
218
138
|
*/
|
|
219
139
|
static getYahrzeit(hyear, gdate) {
|
|
220
|
-
|
|
221
|
-
if (dt === undefined) {
|
|
222
|
-
return dt;
|
|
223
|
-
}
|
|
224
|
-
return new HDate(dt);
|
|
140
|
+
return yahrzeit(hyear, gdate);
|
|
225
141
|
}
|
|
226
142
|
/**
|
|
227
143
|
* Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
|
|
@@ -288,9 +204,12 @@ class HebrewCalendar {
|
|
|
288
204
|
* (Shabbat) to also be a sacred day.
|
|
289
205
|
* @example
|
|
290
206
|
* import {HebrewCalendar} from '@hebcal/core';
|
|
291
|
-
* //
|
|
292
|
-
* //
|
|
293
|
-
*
|
|
207
|
+
* // Wednesday October 16, 2024 is Erev Sukkot 5785. In the Diaspora,
|
|
208
|
+
* // Sukkot I falls on Thursday and Sukkot II on Friday, so Eruv
|
|
209
|
+
* // Tavshilin is prepared on Wednesday:
|
|
210
|
+
* HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), false); // true
|
|
211
|
+
* // In Israel there is only one day of Yom Tov, so Friday is a weekday:
|
|
212
|
+
* HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), true); // false
|
|
294
213
|
* @param date Gregorian or Hebrew date to test
|
|
295
214
|
* @param il use the Israeli holiday schedule
|
|
296
215
|
*/
|
|
@@ -322,14 +241,14 @@ class HebrewCalendar {
|
|
|
322
241
|
* HebrewCalendar.reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'
|
|
323
242
|
* @param timeStr - original time like "20:30"
|
|
324
243
|
* @param suffix - "p" or "pm" or " P.M.". Add leading space if you want it
|
|
325
|
-
* @param options
|
|
244
|
+
* @param options optional; `location`, `locale` and `hour12` are consulted
|
|
326
245
|
*/
|
|
327
246
|
static reformatTimeStr(timeStr, suffix, options) {
|
|
328
247
|
return reformatTimeStr(timeStr, suffix, options);
|
|
329
248
|
}
|
|
330
249
|
/**
|
|
331
250
|
* Returns the semantic version string of the `@hebcal/core` package
|
|
332
|
-
* (e.g. `"
|
|
251
|
+
* (e.g. `"6.8.2"`). Useful for logging or feature detection.
|
|
333
252
|
*/
|
|
334
253
|
static version() {
|
|
335
254
|
return version;
|
|
@@ -342,10 +261,10 @@ class HebrewCalendar {
|
|
|
342
261
|
* since an internal LRU cache (~120 entries) avoids recomputing the
|
|
343
262
|
* keviyah-specific reading pattern.
|
|
344
263
|
* @example
|
|
345
|
-
* import {HebrewCalendar} from '@hebcal/core';
|
|
264
|
+
* import {HebrewCalendar, HDate} from '@hebcal/core';
|
|
346
265
|
* const sedra = HebrewCalendar.getSedra(5784, false);
|
|
347
266
|
* const result = sedra.lookup(new HDate(15, 'Cheshvan', 5784));
|
|
348
|
-
* console.log(result.parsha); // ['
|
|
267
|
+
* console.log(result.parsha); // ['Vayera']
|
|
349
268
|
* @param hyear Hebrew year
|
|
350
269
|
* @param il Use Israel sedra schedule (`false` for Diaspora)
|
|
351
270
|
*/
|
|
@@ -362,12 +281,14 @@ class HebrewCalendar {
|
|
|
362
281
|
* Yom Ha'atzmaut, and Yom Yerushalayim.
|
|
363
282
|
*
|
|
364
283
|
* Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.
|
|
365
|
-
* @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel
|
|
366
284
|
* @example
|
|
367
285
|
* import {HebrewCalendar, HDate, months} from '@hebcal/core';
|
|
368
286
|
* HebrewCalendar.hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)
|
|
369
287
|
* HebrewCalendar.hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)
|
|
370
288
|
* HebrewCalendar.hallel(new HDate(2, months.SHVAT, 5784), false); // 0
|
|
289
|
+
* @param hdate Hebrew date to test
|
|
290
|
+
* @param il use the Israeli holiday schedule
|
|
291
|
+
* @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel
|
|
371
292
|
*/
|
|
372
293
|
static hallel(hdate, il) {
|
|
373
294
|
const events = getHolidaysOnDate(hdate, il);
|
|
@@ -394,12 +315,18 @@ class HebrewCalendar {
|
|
|
394
315
|
* @example
|
|
395
316
|
* import {HebrewCalendar, HDate, months} from '@hebcal/core';
|
|
396
317
|
* // Regular weekday — Tachanun is said at both services
|
|
397
|
-
* HebrewCalendar.tachanun(new HDate(
|
|
318
|
+
* HebrewCalendar.tachanun(new HDate(4, months.SHVAT, 5784), false);
|
|
398
319
|
* // => { shacharit: true, mincha: true, allCongs: true }
|
|
399
320
|
*
|
|
321
|
+
* // Friday 2 Sh'vat — said at Shacharit, but not at Mincha (erev Shabbat)
|
|
322
|
+
* HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);
|
|
323
|
+
* // => { shacharit: true, mincha: false, allCongs: true }
|
|
324
|
+
*
|
|
400
325
|
* // Rosh Chodesh — no Tachanun
|
|
401
326
|
* HebrewCalendar.tachanun(new HDate(1, months.SHVAT, 5784), false);
|
|
402
327
|
* // => { shacharit: false, mincha: false, allCongs: false }
|
|
328
|
+
* @param hdate Hebrew date to test
|
|
329
|
+
* @param il use the Israeli holiday schedule
|
|
403
330
|
*/
|
|
404
331
|
static tachanun(hdate, il) {
|
|
405
332
|
return tachanun(hdate, il);
|
package/dist/esm/hebcal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hebcal.js","sources":["../../../src/hebcal.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\nimport {getBirthdayHD, getYahrzeitHD, HDate} from '@hebcal/hdate';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\nimport {CalOptions} from './CalOptions';\nimport {version as pkgVersion} from './pkgVersion';\nimport {Event, flags} from './event';\nimport {Sedra, getSedra} from './sedra';\nimport {hallel_} from './hallel';\nimport {\n getHolidaysForYear_,\n getHolidaysForYearArray,\n getHolidaysOnDate,\n HolidayYearMap,\n} from './holidays';\nimport {HolidayEvent} from './HolidayEvent';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport {TachanunResult, tachanun} from './tachanun';\nimport {calendar} from './calendar';\n\n/**\n * HebrewCalendar is the main interface to the `@hebcal/core` library.\n * This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,\n * Parashat HaShavua, Daf Yomi, days of the omer, and the molad.\n * Event names can be rendered in several languges using the `locale` option.\n */\nexport class HebrewCalendar {\n private constructor() {}\n /**\n * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.\n *\n * Each holiday is represented by an {@link Event} object which includes a date,\n * a description, flags and optional attributes.\n * If given no options, returns holidays for the Diaspora for the current Gregorian year.\n *\n * The date range returned by this function can be controlled by:\n * * `options.year` - Gregorian (e.g. 1993) or Hebrew year (e.g. 5749)\n * * `options.isHebrewYear` - to interpret `year` as Hebrew year\n * * `options.numYears` - generate calendar for multiple years (default 1, maximum 2000)\n * * `options.month` - Gregorian or Hebrew month (to filter results to a single month)\n *\n * Alternatively, specify start and end days with `Date` or {@link HDate} instances:\n * * `options.start` - use specific start date (requires `end` date)\n * * `options.end` - use specific end date (requires `start` date)\n *\n * Unless `options.noHolidays == true`, default holidays include:\n * * Major holidays - Rosh Hashana, Yom Kippur, Pesach, Sukkot, etc.\n * * Minor holidays - Purim, Chanukah, Tu BiShvat, Lag BaOmer, etc.\n * * Minor fasts - Ta'anit Esther, Tzom Gedaliah, etc. (unless `options.noMinorFast`)\n * * Special Shabbatot - Shabbat Shekalim, Zachor, etc. (unless `options.noSpecialShabbat`)\n * * Modern Holidays - Yom HaShoah, Yom HaAtzma'ut, etc. (unless `options.noModern`)\n * * Rosh Chodesh (unless `options.noRoshChodesh`)\n *\n * Holiday and Torah reading schedules differ between Israel and the Disapora.\n * Set `options.il=true` to use the Israeli schedule.\n *\n * Additional non-default event types can be specified:\n * * Parashat HaShavua - weekly Torah Reading on Saturdays (`options.sedrot`)\n * * Counting of the Omer (`options.omer`)\n * * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)\n * * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)\n * * Yom Kippur Katan (`options.yomKippurKatan`)\n * * Yizkor (`options.yizkor`)\n *\n * Daily Study of texts are supported by the\n * {@link https://github.com/hebcal/hebcal-learning @hebcal/learning} package,\n * for example:\n * * Babylonian Talmud Daf Yomi (`options.dailyLearning.dafYomi`)\n * * Jerusalem Talmud (Yerushalmi) Yomi (`options.dailyLearning.yerushalmi`)\n * * Mishna Yomi (`options.dailyLearning.mishnaYomi`)\n * * Nach Yomi (`options.dailyLearning.nachYomi`)\n *\n * Candle-lighting and Havdalah times are approximated using latitude and longitude\n * specified by the {@link Location} class. The `Location` class contains a small\n * database of cities with their associated geographic information and time-zone information.\n * If you ever have any doubts about Hebcal's times, consult your local halachic authority.\n * If you enter geographic coordinates above the arctic circle or antarctic circle,\n * the times are guaranteed to be wrong.\n *\n * To add candle-lighting options, set `options.candlelighting=true` and set\n * `options.location` to an instance of `Location`. By default, candle lighting\n * time is 18 minutes before sundown (40 minutes for Jerusalem,\n * 30 minutes for Haifa and Zikhron Ya'akov) and Havdalah is\n * calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars\n * are observable in the night time sky with the naked eye). The default Havdalah\n * option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.\n * These defaults can be changed using these options:\n * * `options.candleLightingMins` - minutes before sundown to light candles\n * * `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).\n * Havdalah times are suppressed when `options.havdalahMins=0`.\n * * `options.havdalahDeg` - degrees for solar depression for Havdalah.\n * Default is 8.5 degrees for 3 small stars. Use 7.083 degrees for 3 medium-sized stars.\n * Havdalah times are suppressed when `options.havdalahDeg=0`.\n *\n * If both `options.candlelighting=true` and `options.location` is specified,\n * Chanukah candle-lighting times and minor fast start/end times will also be generated.\n * Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before\n * the sun is 7.083° below the horizon in the evening)\n * on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on\n * Saturday night (see above).\n *\n * Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning) and\n * end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon\n * in the evening).\n *\n * Two options also exist for generating an Event with the Hebrew date:\n * * `options.addHebrewDates` - print the Hebrew date for the entire date range\n * * `options.addHebrewDatesForEvents` - print the Hebrew date for dates with some events\n *\n * Lastly, translation and transliteration of event titles is controlled by\n * `options.locale` and the {@link Locale} API.\n * `@hebcal/core` supports three locales by default:\n * * `en` - default, Sephardic transliterations (e.g. \"Shabbat\")\n * * `ashkenazi` - Ashkenazi transliterations (e.g. \"Shabbos\")\n * * `he` - Hebrew (e.g. \"שַׁבָּת\")\n *\n * Additional locales (such as `ru` or `fr`) are supported by the\n * {@link https://github.com/hebcal/hebcal-locales @hebcal/locales} package\n *\n * @example\n * import {HebrewCalendar, HDate, Location, Event} from '@hebcal/core';\n * const options: CalOptions = {\n * year: 1981,\n * isHebrewYear: false,\n * candlelighting: true,\n * location: Location.lookup('San Francisco'),\n * sedrot: true,\n * omer: true,\n * };\n * const events = HebrewCalendar.calendar(options);\n * for (const ev of events) {\n * const hd = ev.getDate();\n * const date = hd.greg();\n * console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());\n * }\n */\n static calendar(options: CalOptions = {}): Event[] {\n return calendar(options);\n }\n\n /**\n * Calculates a birthday or anniversary (non-yahrzeit).\n * `hyear` must be after original `gdate` of anniversary.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The birthday of someone born in Adar of an ordinary year or Adar II of\n * a leap year is also always in the last month of the year, be that Adar\n * or Adar II. The birthday in an ordinary year of someone born during the\n * first 29 days of Adar I in a leap year is on the corresponding day of Adar;\n * in a leap year, the birthday occurs in Adar I, as expected.\n *\n * Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I\n * has his birthday postponed until the first of the following month in\n * years where that day does not occur. [Calendrical Calculations p. 111]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of event\n * @returns anniversary occurring in `hyear`\n */\n static getBirthdayOrAnniversary(\n hyear: number,\n gdate: Date | HDate\n ): HDate | undefined {\n const dt = getBirthdayHD(hyear, gdate);\n if (dt === undefined) {\n return dt;\n }\n return new HDate(dt);\n }\n\n /**\n * Calculates yahrzeit.\n * `hyear` must be after original `gdate` of death.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The customary anniversary date of a death is more complicated and depends\n * also on the character of the year in which the first anniversary occurs.\n * There are several cases:\n *\n * * If the date of death is Marcheshvan 30, the anniversary in general depends\n * on the first anniversary; if that first anniversary was not Marcheshvan 30,\n * use the day before Kislev 1.\n * * If the date of death is Kislev 30, the anniversary in general again depends\n * on the first anniversary — if that was not Kislev 30, use the day before\n * Tevet 1.\n * * If the date of death is Adar II, the anniversary is the same day in the\n * last month of the Hebrew year (Adar or Adar II).\n * * If the date of death is Adar I 30, the anniversary in a Hebrew year that\n * is not a leap year (in which Adar only has 29 days) is the last day in\n * Shevat.\n * * In all other cases, use the normal (that is, same month number) anniversary\n * of the date of death. [Calendrical Calculations p. 113]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\\'vat 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of death\n * @returns anniversary occurring in hyear\n */\n static getYahrzeit(hyear: number, gdate: Date | HDate): HDate | undefined {\n const dt = getYahrzeitHD(hyear, gdate);\n if (dt === undefined) {\n return dt;\n }\n return new HDate(dt);\n }\n\n /**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events must be filtered for `flags.IL_ONLY`\n * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.\n *\n * Includes Rosh Chodesh, fasts, Yom Kippur Katan, Special Shabbatot, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * The result is cached in an internal LRU.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const map = HebrewCalendar.getHolidaysForYear(5784);\n * for (const [hdStr, events] of map.entries()) {\n * for (const ev of events) {\n * console.log(hdStr, ev.getDesc());\n * }\n * }\n * @param year Hebrew year\n */\n static getHolidaysForYear(year: number): HolidayYearMap {\n return getHolidaysForYear_(year);\n }\n\n /**\n * Returns a sorted array of holidays observed during the given Hebrew year.\n *\n * Events are pre-filtered by Israel vs. Diaspora schedule, so callers do not\n * need to inspect `flags.IL_ONLY` / `flags.CHUL_ONLY` themselves.\n * Includes Rosh Chodesh, fasts, modern holidays, special Shabbatot, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const events = HebrewCalendar.getHolidaysForYearArray(5784, false);\n * console.log(events[0].getDesc()); // 'Rosh Hashana 5784'\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\n static getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n return getHolidaysForYearArray(year, il);\n }\n\n /**\n * Returns an array of holiday Events that occur on the given date,\n * or `undefined` if no holidays occur that day.\n *\n * When `il` is omitted, both Diaspora-only and Israel-only events are\n * returned; pass `true` or `false` to filter to a single schedule.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * const hd = new HDate(15, months.NISAN, 5784);\n * const events = HebrewCalendar.getHolidaysOnDate(hd, false);\n * console.log(events?.map(ev => ev.getDesc())); // ['Pesach I']\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\n static getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n ): HolidayEvent[] | undefined {\n return getHolidaysOnDate(date, il);\n }\n\n /**\n * Returns `true` if Eruv Tavshilin should be prepared on the given date.\n *\n * Eruv Tavshilin is prepared when a Yom Tov falls on Friday (so cooking\n * for Shabbat that begins Friday night may continue from Yom Tov into\n * Shabbat). This requires the day before to be a weekday (Wednesday or\n * Thursday), the following Friday to be Yom Tov, and the day after Friday\n * (Shabbat) to also be a sacred day.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * // Thursday April 25, 2024 — first day of Pesach 5784, with Shabbat\n * // chol ha-moed the next day, so Eruv Tavshilin is required:\n * HebrewCalendar.eruvTavshilin(new Date(2024, 3, 25), false); // true\n * @param date Gregorian or Hebrew date to test\n * @param il use the Israeli holiday schedule\n */\n static eruvTavshilin(date: Date | HDate, il: boolean): boolean {\n if (date.getDay() < 3 || date.getDay() > 4) {\n return false;\n }\n const today = new HDate(date);\n const friday = today.after(5);\n const tomorrow = today.next();\n if (!isChag(friday, il) || isChag(today, il) || !isChag(tomorrow, il)) {\n return false;\n }\n return true;\n }\n\n /**\n * Helper function to format a 24-hour (00:00-23:59) time string in either\n * 12-hour US format (e.g. `\"8:13pm\"`) or keep it in 24-hour format (e.g.\n * `\"20:13\"`) for any other locale or country.\n *\n * The locale (and therefore default behavior) is derived from\n * `options.location` / `options.locale`. The `options.hour12` override\n * takes precedence: if `false`, locale is ignored and the result is always\n * 24-hour; if `true`, locale is ignored and the result is always 12-hour.\n * @example\n * import {HebrewCalendar, Location} from '@hebcal/core';\n * const opts = {location: Location.lookup('Chicago')};\n * HebrewCalendar.reformatTimeStr('20:30', 'pm', opts); // '8:30pm'\n * HebrewCalendar.reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options\n */\n static reformatTimeStr(\n timeStr: string,\n suffix: string,\n options: CalOptions\n ): string {\n return reformatTimeStr(timeStr, suffix, options);\n }\n\n /**\n * Returns the semantic version string of the `@hebcal/core` package\n * (e.g. `\"5.10.0\"`). Useful for logging or feature detection.\n */\n static version(): string {\n return pkgVersion;\n }\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 + schedule.\n *\n * Use this in preference to `new Sedra(...)` when calling repeatedly,\n * since an internal LRU cache (~120 entries) avoids recomputing the\n * keviyah-specific reading pattern.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const sedra = HebrewCalendar.getSedra(5784, false);\n * const result = sedra.lookup(new HDate(15, 'Cheshvan', 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\n static getSedra(hyear: number, il: boolean): Sedra {\n return getSedra(hyear, il);\n }\n\n /**\n * Determines which form of Hallel (if any) is recited\n * on a given Hebrew date.\n *\n * Returns 0 (none), 1 (half Hallel), or 2 (whole Hallel).\n *\n * Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.\n * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * HebrewCalendar.hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)\n * HebrewCalendar.hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)\n * HebrewCalendar.hallel(new HDate(2, months.SHVAT, 5784), false); // 0\n */\n static hallel(hdate: HDate, il: boolean): number {\n const events = getHolidaysOnDate(hdate, il);\n if (!events) {\n return 0;\n }\n return hallel_(events, hdate);\n }\n\n /**\n * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.\n *\n * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,\n * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,\n * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,\n * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.\n *\n * In some congregations Tachanun is not said until from Rosh Chodesh Sivan\n * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Tachanun is not said at Mincha on days before it is not said at Shacharit.\n *\n * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * // Regular weekday — Tachanun is said at both services\n * HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);\n * // => { shacharit: true, mincha: true, allCongs: true }\n *\n * // Rosh Chodesh — no Tachanun\n * HebrewCalendar.tachanun(new HDate(1, months.SHVAT, 5784), false);\n * // => { shacharit: false, mincha: false, allCongs: false }\n */\n static tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun(hdate, il);\n }\n}\n\n/**\n * @private\n */\nfunction isChag(date: HDate, il: boolean): boolean {\n const events = getHolidaysOnDate(date, il) || [];\n const chag = events.filter(ev => ev.getFlags() & flags.CHAG);\n return chag.length !== 0;\n}\n"],"names":["pkgVersion"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAoBH;;;;;AAKG;MACU,cAAc,CAAA;AACzB,IAAA,WAAA,GAAA,EAAuB;AACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2GG;AACH,IAAA,OAAO,QAAQ,CAAC,OAAA,GAAsB,EAAE,EAAA;AACtC,QAAA,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC1B;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACH,IAAA,OAAO,wBAAwB,CAC7B,KAAa,EACb,KAAmB,EAAA;QAEnB,MAAM,EAAE,GAAG,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;AACtC,QAAA,IAAI,EAAE,KAAK,SAAS,EAAE;AACpB,YAAA,OAAO,EAAE;QACX;AACA,QAAA,OAAO,IAAI,KAAK,CAAC,EAAE,CAAC;IACtB;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;AACH,IAAA,OAAO,WAAW,CAAC,KAAa,EAAE,KAAmB,EAAA;QACnD,MAAM,EAAE,GAAG,aAAa,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AAe,EACf,MAAc,EACd,OAAmB,EAAA;QAEnB,OAAO,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;IAClD;AAEA;;;AAGG;AACH,IAAA,OAAO,OAAO,GAAA;AACZ,QAAA,OAAOA,OAAU;IACnB;AAEA;;;;;;;;;;;;;;AAcG;AACH,IAAA,OAAO,QAAQ,CAAC,KAAa,EAAE,EAAW,EAAA;AACxC,QAAA,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;IAC5B;AAEA;;;;;;;;;;;;;;;;AAgBG;AACH,IAAA,OAAO,MAAM,CAAC,KAAY,EAAE,EAAW,EAAA;QACrC,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,EAAE,CAAC;QAC3C,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,OAAO,CAAC;QACV;AACA,QAAA,OAAO,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC;IAC/B;AAEA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACH,IAAA,OAAO,QAAQ,CAAC,KAAY,EAAE,EAAW,EAAA;AACvC,QAAA,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;IAC5B;AACD;AAED;;AAEG;AACH,SAAS,MAAM,CAAC,IAAW,EAAE,EAAW,EAAA;IACtC,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;AAChD,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;AAC5D,IAAA,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC;AAC1B;;;;"}
|
|
1
|
+
{"version":3,"file":"hebcal.js","sources":["../../../src/hebcal.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\nimport {birthdayOrAnniversary, yahrzeit, HDate} from '@hebcal/hdate';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\nimport {CalOptions} from './CalOptions';\nimport {version as pkgVersion} from './pkgVersion';\nimport {Event, flags} from './event';\nimport {Sedra, getSedra} from './sedra';\nimport {hallel_} from './hallel';\nimport {\n getHolidaysForYear_,\n getHolidaysForYearArray,\n getHolidaysOnDate,\n HolidayYearMap,\n} from './holidays';\nimport {HolidayEvent} from './HolidayEvent';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport {TachanunResult, tachanun} from './tachanun';\nimport {calendar} from './calendar';\n\n/**\n * HebrewCalendar is the main interface to the `@hebcal/core` library.\n * This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,\n * Parashat HaShavua, Daf Yomi, days of the omer, and the molad.\n * Event names can be rendered in several languges using the `locale` option.\n */\nexport class HebrewCalendar {\n private constructor() {}\n /**\n * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.\n *\n * Each holiday is represented by an {@link Event} object which includes a date,\n * a description, flags and optional attributes.\n * If given no options, returns holidays for the Diaspora for the current Gregorian year.\n *\n * This is a convenience wrapper around the standalone {@link calendar} function.\n * See {@link calendar} for the complete list of supported options, the\n * candle-lighting and Havdalah defaults, and notes on locales.\n *\n * @example\n * import {HebrewCalendar, Location} from '@hebcal/core';\n * const options: CalOptions = {\n * year: 1981,\n * isHebrewYear: false,\n * candlelighting: true,\n * location: Location.lookup('San Francisco'),\n * sedrot: true,\n * omer: true,\n * };\n * const events = HebrewCalendar.calendar(options);\n * for (const ev of events) {\n * const hd = ev.getDate();\n * const date = hd.greg();\n * console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());\n * }\n */\n static calendar(options: CalOptions = {}): Event[] {\n return calendar(options);\n }\n\n /**\n * Calculates a birthday or anniversary (non-yahrzeit).\n * Returns `undefined` when `hyear` precedes the original year of `gdate`.\n *\n * When `hyear` is the original year, the original date is returned unchanged —\n * a \"0th birthday\" is a meaningful thing to ask for. This differs from\n * {@link getYahrzeit}, which returns `undefined` for the original year,\n * because a yahrzeit only has meaning from the first anniversary onward.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The birthday of someone born in Adar of an ordinary year or Adar II of\n * a leap year is also always in the last month of the year, be that Adar\n * or Adar II. The birthday in an ordinary year of someone born during the\n * first 29 days of Adar I in a leap year is on the corresponding day of Adar;\n * in a leap year, the birthday occurs in Adar I, as expected.\n *\n * Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I\n * has his birthday postponed until the first of the following month in\n * years where that day does not occur. [Calendrical Calculations p. 111]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of event\n * @returns anniversary occurring in `hyear`\n */\n static getBirthdayOrAnniversary(\n hyear: number,\n gdate: Date | HDate\n ): HDate | undefined {\n return birthdayOrAnniversary(hyear, gdate);\n }\n\n /**\n * Calculates yahrzeit.\n * `hyear` must be after original `gdate` of death.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The customary anniversary date of a death is more complicated and depends\n * also on the character of the year in which the first anniversary occurs.\n * There are several cases:\n *\n * * If the date of death is Marcheshvan 30, the anniversary in general depends\n * on the first anniversary; if that first anniversary was not Marcheshvan 30,\n * use the day before Kislev 1.\n * * If the date of death is Kislev 30, the anniversary in general again depends\n * on the first anniversary — if that was not Kislev 30, use the day before\n * Tevet 1.\n * * If the date of death is Adar II, the anniversary is the same day in the\n * last month of the Hebrew year (Adar or Adar II).\n * * If the date of death is Adar I 30, the anniversary in a Hebrew year that\n * is not a leap year (in which Adar only has 29 days) is the last day in\n * Shevat.\n * * In all other cases, use the normal (that is, same month number) anniversary\n * of the date of death. [Calendrical Calculations p. 113]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\\'vat 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of death\n * @returns anniversary occurring in hyear\n */\n static getYahrzeit(hyear: number, gdate: Date | HDate): HDate | undefined {\n return yahrzeit(hyear, gdate);\n }\n\n /**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events must be filtered for `flags.IL_ONLY`\n * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.\n *\n * Includes Rosh Chodesh, fasts, Yom Kippur Katan, Special Shabbatot, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * The result is cached in an internal LRU.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const map = HebrewCalendar.getHolidaysForYear(5784);\n * for (const [hdStr, events] of map.entries()) {\n * for (const ev of events) {\n * console.log(hdStr, ev.getDesc());\n * }\n * }\n * @param year Hebrew year\n */\n static getHolidaysForYear(year: number): HolidayYearMap {\n return getHolidaysForYear_(year);\n }\n\n /**\n * Returns a sorted array of holidays observed during the given Hebrew year.\n *\n * Events are pre-filtered by Israel vs. Diaspora schedule, so callers do not\n * need to inspect `flags.IL_ONLY` / `flags.CHUL_ONLY` themselves.\n * Includes Rosh Chodesh, fasts, modern holidays, special Shabbatot, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const events = HebrewCalendar.getHolidaysForYearArray(5784, false);\n * console.log(events[0].getDesc()); // 'Rosh Hashana 5784'\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\n static getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n return getHolidaysForYearArray(year, il);\n }\n\n /**\n * Returns an array of holiday Events that occur on the given date,\n * or `undefined` if no holidays occur that day.\n *\n * When `il` is omitted, both Diaspora-only and Israel-only events are\n * returned; pass `true` or `false` to filter to a single schedule.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * const hd = new HDate(15, months.NISAN, 5784);\n * const events = HebrewCalendar.getHolidaysOnDate(hd, false);\n * console.log(events?.map(ev => ev.getDesc())); // ['Pesach I']\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\n static getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n ): HolidayEvent[] | undefined {\n return getHolidaysOnDate(date, il);\n }\n\n /**\n * Returns `true` if Eruv Tavshilin should be prepared on the given date.\n *\n * Eruv Tavshilin is prepared when a Yom Tov falls on Friday (so cooking\n * for Shabbat that begins Friday night may continue from Yom Tov into\n * Shabbat). This requires the day before to be a weekday (Wednesday or\n * Thursday), the following Friday to be Yom Tov, and the day after Friday\n * (Shabbat) to also be a sacred day.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * // Wednesday October 16, 2024 is Erev Sukkot 5785. In the Diaspora,\n * // Sukkot I falls on Thursday and Sukkot II on Friday, so Eruv\n * // Tavshilin is prepared on Wednesday:\n * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), false); // true\n * // In Israel there is only one day of Yom Tov, so Friday is a weekday:\n * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), true); // false\n * @param date Gregorian or Hebrew date to test\n * @param il use the Israeli holiday schedule\n */\n static eruvTavshilin(date: Date | HDate, il: boolean): boolean {\n if (date.getDay() < 3 || date.getDay() > 4) {\n return false;\n }\n const today = new HDate(date);\n const friday = today.after(5);\n const tomorrow = today.next();\n if (!isChag(friday, il) || isChag(today, il) || !isChag(tomorrow, il)) {\n return false;\n }\n return true;\n }\n\n /**\n * Helper function to format a 24-hour (00:00-23:59) time string in either\n * 12-hour US format (e.g. `\"8:13pm\"`) or keep it in 24-hour format (e.g.\n * `\"20:13\"`) for any other locale or country.\n *\n * The locale (and therefore default behavior) is derived from\n * `options.location` / `options.locale`. The `options.hour12` override\n * takes precedence: if `false`, locale is ignored and the result is always\n * 24-hour; if `true`, locale is ignored and the result is always 12-hour.\n * @example\n * import {HebrewCalendar, Location} from '@hebcal/core';\n * const opts = {location: Location.lookup('Chicago')};\n * HebrewCalendar.reformatTimeStr('20:30', 'pm', opts); // '8:30pm'\n * HebrewCalendar.reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options optional; `location`, `locale` and `hour12` are consulted\n */\n static reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n ): string {\n return reformatTimeStr(timeStr, suffix, options);\n }\n\n /**\n * Returns the semantic version string of the `@hebcal/core` package\n * (e.g. `\"6.8.2\"`). Useful for logging or feature detection.\n */\n static version(): string {\n return pkgVersion;\n }\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 + schedule.\n *\n * Use this in preference to `new Sedra(...)` when calling repeatedly,\n * since an internal LRU cache (~120 entries) avoids recomputing the\n * keviyah-specific reading pattern.\n * @example\n * import {HebrewCalendar, HDate} from '@hebcal/core';\n * const sedra = HebrewCalendar.getSedra(5784, false);\n * const result = sedra.lookup(new HDate(15, 'Cheshvan', 5784));\n * console.log(result.parsha); // ['Vayera']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\n static getSedra(hyear: number, il: boolean): Sedra {\n return getSedra(hyear, il);\n }\n\n /**\n * Determines which form of Hallel (if any) is recited\n * on a given Hebrew date.\n *\n * Returns 0 (none), 1 (half Hallel), or 2 (whole Hallel).\n *\n * Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * HebrewCalendar.hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)\n * HebrewCalendar.hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)\n * HebrewCalendar.hallel(new HDate(2, months.SHVAT, 5784), false); // 0\n * @param hdate Hebrew date to test\n * @param il use the Israeli holiday schedule\n * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel\n */\n static hallel(hdate: HDate, il: boolean): number {\n const events = getHolidaysOnDate(hdate, il);\n if (!events) {\n return 0;\n }\n return hallel_(events, hdate);\n }\n\n /**\n * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.\n *\n * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,\n * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,\n * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,\n * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.\n *\n * In some congregations Tachanun is not said until from Rosh Chodesh Sivan\n * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Tachanun is not said at Mincha on days before it is not said at Shacharit.\n *\n * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * // Regular weekday — Tachanun is said at both services\n * HebrewCalendar.tachanun(new HDate(4, months.SHVAT, 5784), false);\n * // => { shacharit: true, mincha: true, allCongs: true }\n *\n * // Friday 2 Sh'vat — said at Shacharit, but not at Mincha (erev Shabbat)\n * HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);\n * // => { shacharit: true, mincha: false, allCongs: true }\n *\n * // Rosh Chodesh — no Tachanun\n * HebrewCalendar.tachanun(new HDate(1, months.SHVAT, 5784), false);\n * // => { shacharit: false, mincha: false, allCongs: false }\n * @param hdate Hebrew date to test\n * @param il use the Israeli holiday schedule\n */\n static tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun(hdate, il);\n }\n}\n\n/**\n * @private\n */\nfunction isChag(date: HDate, il: boolean): boolean {\n const events = getHolidaysOnDate(date, il) || [];\n const chag = events.filter(ev => ev.getFlags() & flags.CHAG);\n return chag.length !== 0;\n}\n"],"names":["pkgVersion"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAoBH;;;;;AAKG;MACU,cAAc,CAAA;AACzB,IAAA,WAAA,GAAA,EAAuB;AACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AACH,IAAA,OAAO,QAAQ,CAAC,OAAA,GAAsB,EAAE,EAAA;AACtC,QAAA,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC1B;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AACH,IAAA,OAAO,wBAAwB,CAC7B,KAAa,EACb,KAAmB,EAAA;AAEnB,QAAA,OAAO,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC;IAC5C;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;AACH,IAAA,OAAO,WAAW,CAAC,KAAa,EAAE,KAAmB,EAAA;AACnD,QAAA,O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;AAEA;;;AAGG;AACH,IAAA,OAAO,OAAO,GAAA;AACZ,QAAA,OAAOA,OAAU;IACnB;AAEA;;;;;;;;;;;;;;AAcG;AACH,IAAA,OAAO,QAAQ,CAAC,KAAa,EAAE,EAAW,EAAA;AACxC,QAAA,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;IAC5B;AAEA;;;;;;;;;;;;;;;;;;AAkBG;AACH,IAAA,OAAO,MAAM,CAAC,KAAY,EAAE,EAAW,EAAA;QACrC,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,EAAE,CAAC;QAC3C,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,OAAO,CAAC;QACV;AACA,QAAA,OAAO,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC;IAC/B;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACH,IAAA,OAAO,QAAQ,CAAC,KAAY,EAAE,EAAW,EAAA;AACvC,QAAA,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;IAC5B;AACD;AAED;;AAEG;AACH,SAAS,MAAM,CAAC,IAAW,EAAE,EAAW,EAAA;IACtC,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;AAChD,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;AAC5D,IAAA,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC;AAC1B;;;;"}
|
package/dist/esm/holidays.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ import { HolidayEvent } from './HolidayEvent';
|
|
|
16
16
|
* @param [il] use the Israeli schedule for holidays
|
|
17
17
|
*/
|
|
18
18
|
export declare function getHolidaysOnDate(date: HDate | Date | number, il?: boolean): HolidayEvent[] | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Holidays for an entire Hebrew year, indexed by `HDate.toString()`
|
|
21
|
+
* (e.g. `'15 Nisan 5784'`). Returned by
|
|
22
|
+
* {@link HebrewCalendar.getHolidaysForYear}. Because a single date can carry
|
|
23
|
+
* more than one event, each key maps to an array. Entries are *not* filtered
|
|
24
|
+
* by Israel vs. Diaspora — inspect `flags.IL_ONLY` / `flags.CHUL_ONLY`.
|
|
25
|
+
*/
|
|
19
26
|
export type HolidayYearMap = Map<string, HolidayEvent[]>;
|
|
20
27
|
/**
|
|
21
28
|
* Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
|
|
@@ -30,7 +37,7 @@ export declare function getHolidaysForYear_(year: number): HolidayYearMap;
|
|
|
30
37
|
*
|
|
31
38
|
* Includes Rosh Chodesh, fasts, special Shabbatot, modern holidays, etc.,
|
|
32
39
|
* but does not generate candle-lighting times, Torah readings, or Omer days.
|
|
33
|
-
* Use {@link
|
|
40
|
+
* Use {@link calendar} for those.
|
|
34
41
|
* @example
|
|
35
42
|
* import {getHolidaysForYearArray} from '@hebcal/core';
|
|
36
43
|
* const events = getHolidaysForYearArray(5784, false);
|
package/dist/esm/holidays.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.9.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { months, HDate } from '@hebcal/hdate';
|
|
3
3
|
import QuickLRU from 'quick-lru';
|
|
4
4
|
import { flags } from './event.js';
|
|
@@ -302,7 +302,7 @@ function getBirkatHaChama(year) {
|
|
|
302
302
|
*
|
|
303
303
|
* Includes Rosh Chodesh, fasts, special Shabbatot, modern holidays, etc.,
|
|
304
304
|
* but does not generate candle-lighting times, Torah readings, or Omer days.
|
|
305
|
-
* Use {@link
|
|
305
|
+
* Use {@link calendar} for those.
|
|
306
306
|
* @example
|
|
307
307
|
* import {getHolidaysForYearArray} from '@hebcal/core';
|
|
308
308
|
* const events = getHolidaysForYearArray(5784, false);
|
package/dist/esm/holidays.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"holidays.js","sources":["../../../src/holidays.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 {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport {flags} from './event';\nimport {dateYomHaShoah, dateYomHaZikaron} from './modern';\nimport {getSedra} from './sedra';\nimport {\n staticHolidays,\n staticModernHolidays,\n holidayDesc as hdesc,\n} from './staticHolidays';\nimport {YomKippurKatanEvent} from './YomKippurKatanEvent';\nimport {\n HolidayEvent,\n ChanukahEvent,\n AsaraBTevetEvent,\n RoshHashanaEvent,\n RoshChodeshEvent,\n} from './HolidayEvent';\n\n/**\n * Returns an array of holiday Events that occur on the given date, or\n * `undefined` if no holidays occur that day.\n *\n * When `il` is omitted, both Diaspora-only and Israel-only events are\n * returned (e.g. on the second day of a Yom Tov, both `\"Pesach II\"` for\n * Diaspora and any Israel-only events). Pass `true` or `false` to filter\n * to a single schedule.\n * @example\n * import {getHolidaysOnDate, HDate, months} from '@hebcal/core';\n * const events = getHolidaysOnDate(new HDate(15, months.NISAN, 5784), false);\n * events?.map(ev => ev.getDesc()); // ['Pesach I']\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\nexport function getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n): HolidayEvent[] | undefined {\n const hd = HDate.isHDate(date) ? (date as HDate) : new HDate(date);\n const hdStr = hd.toString();\n const yearMap = getHolidaysForYear_(hd.getFullYear());\n const events = yearMap.get(hdStr);\n // if il isn't a boolean return both diaspora + IL for day\n if (il === undefined || events === undefined) {\n return events;\n }\n const filtered = events.filter(ev => ev.observedIn(il));\n return filtered;\n}\n\nconst CHAG = flags.CHAG;\nconst IL_ONLY = flags.IL_ONLY;\nconst LIGHT_CANDLES_TZEIS = flags.LIGHT_CANDLES_TZEIS;\nconst CHANUKAH_CANDLES = flags.CHANUKAH_CANDLES;\nconst BEHAB = flags.BEHAB;\nconst MINOR_FAST = flags.MINOR_FAST;\nconst SPECIAL_SHABBAT = flags.SPECIAL_SHABBAT;\nconst MODERN_HOLIDAY = flags.MODERN_HOLIDAY;\nconst MAJOR_FAST = flags.MAJOR_FAST;\nconst MINOR_HOLIDAY = flags.MINOR_HOLIDAY;\nconst EREV = flags.EREV;\n\nconst SUN = 0;\nconst TUE = 2;\nconst THU = 4;\nconst FRI = 5;\nconst SAT = 6;\n\nconst NISAN = months.NISAN;\nconst IYYAR = months.IYYAR;\nconst TAMUZ = months.TAMUZ;\nconst AV = months.AV;\nconst TISHREI = months.TISHREI;\nconst CHESHVAN = months.CHESHVAN;\nconst KISLEV = months.KISLEV;\nconst TEVET = months.TEVET;\nconst ADAR_I = months.ADAR_I;\nconst ADAR_II = months.ADAR_II;\n\nconst emojiIsraelFlag = {emoji: '🇮🇱'} as const;\nexport type HolidayYearMap = Map<string, HolidayEvent[]>;\nconst yearCache = new QuickLRU<number, HolidayYearMap>({maxSize: 120});\n\n/**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`\n * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.\n * @private\n */\nexport function getHolidaysForYear_(year: number): HolidayYearMap {\n if (typeof year !== 'number') {\n throw new TypeError(`bad Hebrew year: ${year}`);\n }\n if (year < 1 || year > 32658) {\n throw new RangeError(`Hebrew year ${year} out of range 1-32658`);\n }\n const cached = yearCache.get(year);\n if (cached) {\n return cached;\n }\n\n const RH = new HDate(1, TISHREI, year);\n const pesach = new HDate(15, NISAN, year);\n\n const map = new Map<string, HolidayEvent[]>();\n function add(...events: HolidayEvent[]) {\n for (const ev of events) {\n const key = ev.date.toString();\n const arr = map.get(key);\n if (typeof arr === 'object') {\n if (arr[0].getFlags() & EREV) {\n arr.unshift(ev);\n } else {\n arr.push(ev);\n }\n } else {\n map.set(key, [ev]);\n }\n }\n }\n\n for (const h of staticHolidays) {\n const hd = new HDate(h.dd, h.mm, year);\n const attrs: any = {};\n if (h.emoji) attrs.emoji = h.emoji;\n if (h.chmDay) attrs.cholHaMoedDay = h.chmDay;\n const ev = new HolidayEvent(hd, h.desc, h.flags, attrs);\n add(ev);\n }\n\n // standard holidays that don't shift based on year\n add(new RoshHashanaEvent(RH, year, CHAG | LIGHT_CANDLES_TZEIS));\n\n // Variable date holidays\n const tzomGedaliahDay: number = RH.getDay() === THU ? 4 : 3;\n add(\n new HolidayEvent(\n new HDate(tzomGedaliahDay, TISHREI, year),\n hdesc.TZOM_GEDALIAH,\n MINOR_FAST\n )\n );\n // first SAT after RH\n add(\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, 7 + RH.abs())),\n hdesc.SHABBAT_SHUVA,\n SPECIAL_SHABBAT\n )\n );\n const rchTevet = HDate.shortKislev(year)\n ? new HDate(1, TEVET, year)\n : new HDate(30, KISLEV, year);\n add(new HolidayEvent(rchTevet, hdesc.CHAG_HABANOT, MINOR_HOLIDAY));\n add(\n new ChanukahEvent(\n new HDate(24, KISLEV, year),\n hdesc.CHANUKAH_1_CANDLE,\n EREV | MINOR_HOLIDAY | CHANUKAH_CANDLES,\n undefined\n )\n );\n // yes, we know Kislev 30-32 are wrong\n // HDate() corrects the month automatically\n for (let candles = 2; candles <= 8; candles++) {\n const hd = new HDate(23 + candles, KISLEV, year);\n add(\n new ChanukahEvent(\n hd,\n `Chanukah: ${candles} Candles`,\n MINOR_HOLIDAY | CHANUKAH_CANDLES,\n candles - 1\n )\n );\n }\n add(\n new ChanukahEvent(\n new HDate(32, KISLEV, year),\n hdesc.CHANUKAH_8TH_DAY,\n MINOR_HOLIDAY,\n 8\n )\n );\n add(\n new AsaraBTevetEvent(new HDate(10, TEVET, year), hdesc.ASARA_BTEVET, MINOR_FAST)\n );\n const pesachAbs = pesach.abs();\n add(\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 43)),\n hdesc.SHABBAT_SHEKALIM,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 30)),\n hdesc.SHABBAT_ZACHOR,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(pesachAbs - (pesach.getDay() === TUE ? 33 : 31)),\n hdesc.TAANIT_ESTHER,\n MINOR_FAST\n )\n );\n const haChodeshAbs = HDate.dayOnOrBefore(SAT, pesachAbs - 14);\n add(\n new HolidayEvent(\n new HDate(haChodeshAbs - 7),\n hdesc.SHABBAT_PARAH,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(haChodeshAbs),\n hdesc.SHABBAT_HACHODESH,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 1)),\n hdesc.SHABBAT_HAGADOL,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n // if the fast falls on Shabbat, move to Thursday\n pesach.prev().getDay() === SAT\n ? pesach.onOrBefore(THU)\n : new HDate(14, NISAN, year),\n hdesc.TAANIT_BECHOROT,\n MINOR_FAST\n )\n );\n add(\n new HolidayEvent(\n new HDate(\n HDate.dayOnOrBefore(SAT, new HDate(1, TISHREI, year + 1).abs() - 4)\n ),\n hdesc.LEIL_SELICHOT,\n MINOR_HOLIDAY,\n {emoji: '🕍'}\n )\n );\n\n if (pesach.getDay() === SUN) {\n add(\n new HolidayEvent(\n new HDate(16, ADAR_II, year),\n hdesc.PURIM_MESHULASH,\n MINOR_HOLIDAY\n )\n );\n }\n\n if (HDate.isLeapYear(year)) {\n add(\n new HolidayEvent(\n new HDate(14, ADAR_I, year),\n hdesc.PURIM_KATAN,\n MINOR_HOLIDAY,\n {emoji: '🎭️'}\n )\n );\n add(\n new HolidayEvent(\n new HDate(15, ADAR_I, year),\n hdesc.SHUSHAN_PURIM_KATAN,\n MINOR_HOLIDAY,\n {emoji: '🎭️'}\n )\n );\n }\n\n const nisan27dt = dateYomHaShoah(year);\n if (nisan27dt) {\n add(new HolidayEvent(nisan27dt, hdesc.YOM_HASHOAH, MODERN_HOLIDAY));\n }\n\n const yomHaZikaronDt = dateYomHaZikaron(year);\n if (yomHaZikaronDt) {\n add(\n new HolidayEvent(\n yomHaZikaronDt,\n hdesc.YOM_HAZIKARON,\n MODERN_HOLIDAY,\n emojiIsraelFlag\n ),\n new HolidayEvent(\n yomHaZikaronDt.next(),\n hdesc.YOM_HAATZMA_UT,\n MODERN_HOLIDAY,\n emojiIsraelFlag\n )\n );\n }\n\n for (const h of staticModernHolidays) {\n if (year >= h.firstYear) {\n let hd = new HDate(h.dd, h.mm, year);\n const dow = hd.getDay();\n if (h.friSatMovetoThu && (dow === FRI || dow === SAT)) {\n hd = hd.onOrBefore(THU);\n } else if (h.friPostponeToSun && dow === FRI) {\n hd = new HDate(hd.abs() + 2);\n } else if (h.satPostponeToSun && dow === SAT) {\n hd = hd.next();\n }\n const mask = h.chul ? MODERN_HOLIDAY : MODERN_HOLIDAY | IL_ONLY;\n const ev = new HolidayEvent(hd, h.desc, mask);\n if (!h.suppressEmoji) {\n ev.emoji = '🇮🇱';\n }\n add(ev);\n }\n }\n\n let tamuz17 = new HDate(17, TAMUZ, year);\n let tamuz17attrs;\n if (tamuz17.getDay() === SAT) {\n tamuz17 = new HDate(18, TAMUZ, year);\n tamuz17attrs = {observed: true};\n }\n add(new HolidayEvent(tamuz17, hdesc.TZOM_TAMMUZ, MINOR_FAST, tamuz17attrs));\n\n let av9dt = new HDate(9, AV, year);\n let av9title = hdesc.TISHA_BAV;\n let av9attrs;\n if (av9dt.getDay() === SAT) {\n av9dt = av9dt.next();\n av9attrs = {observed: true};\n av9title += ' (observed)';\n }\n const av9abs = av9dt.abs();\n add(\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, av9abs)),\n hdesc.SHABBAT_CHAZON,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n av9dt.prev(),\n hdesc.EREV_TISHA_BAV,\n EREV | MAJOR_FAST,\n av9attrs\n ),\n new HolidayEvent(av9dt, av9title, MAJOR_FAST, av9attrs),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, av9abs + 7)),\n hdesc.SHABBAT_NACHAMU,\n SPECIAL_SHABBAT\n )\n );\n\n const monthsInYear = HDate.monthsInYear(year);\n for (let month = 1; month <= monthsInYear; month++) {\n const monthName = HDate.getMonthName(month, year);\n if (\n (month === NISAN\n ? HDate.daysInMonth(HDate.monthsInYear(year - 1), year - 1)\n : HDate.daysInMonth(month - 1, year)) === 30\n ) {\n add(new RoshChodeshEvent(new HDate(1, month, year), monthName));\n add(new RoshChodeshEvent(new HDate(30, month - 1, year), monthName));\n } else if (month !== TISHREI) {\n add(new RoshChodeshEvent(new HDate(1, month, year), monthName));\n }\n }\n\n // Begin: Yom Kippur Katan\n // start at Iyyar because one may not fast during Nisan\n for (let month = months.IYYAR; month <= monthsInYear; month++) {\n const nextMonth = month + 1;\n // Yom Kippur Katan is not observed on the day before Rosh Hashanah.\n // Not observed prior to Rosh Chodesh Cheshvan because Yom Kippur has just passed.\n // Not observed before Rosh Chodesh Tevet, because that day is Hanukkah.\n if (\n nextMonth === TISHREI ||\n nextMonth === months.CHESHVAN ||\n nextMonth === TEVET\n ) {\n continue;\n }\n let ykk = new HDate(29, month, year);\n const dow = ykk.getDay();\n if (dow === FRI || dow === SAT) {\n ykk = ykk.onOrBefore(THU);\n }\n\n const nextMonthName = HDate.getMonthName(nextMonth, year);\n const ev = new YomKippurKatanEvent(ykk, nextMonthName);\n add(ev);\n }\n\n for (const month of [CHESHVAN, IYYAR]) {\n const roshChodesh = new HDate(1, month, year);\n let shabbos = new HDate(HDate.dayOnOrBefore(SAT, roshChodesh.abs() + 6));\n if (shabbos.abs() === roshChodesh.abs()) {\n shabbos = new HDate(shabbos.abs() + 7);\n }\n const fastDays = [2, 5, 9].map(offset => new HDate(shabbos.abs() + offset));\n if (month === IYYAR && fastDays[2].getDate() === 14) {\n fastDays[2] = new HDate(17, IYYAR, year);\n }\n for (const hd of fastDays) {\n add(new HolidayEvent(hd, hdesc.TAANIT_BEHAB, MINOR_FAST | BEHAB));\n }\n }\n\n const sedra = getSedra(year, false);\n const beshalachHd = sedra.find(15) as HDate;\n add(new HolidayEvent(beshalachHd, hdesc.SHABBAT_SHIRAH, SPECIAL_SHABBAT));\n\n // Birkat Hachamah appears only once every 28 years\n const birkatHaChama = getBirkatHaChama(year);\n if (birkatHaChama) {\n const hd = new HDate(birkatHaChama);\n add(new HolidayEvent(hd, hdesc.BIRKAT_HACHAMAH, MINOR_HOLIDAY, {emoji: '☀️'}));\n }\n\n yearCache.set(year, map);\n return map;\n}\n\n/**\n * Birkat Hachamah appears only once every 28 years.\n * Although almost always in Nisan, it can occur in Adar II.\n * - 27 Adar II 5461 (Gregorian year 1701)\n * - 29 Adar II 5993 (Gregorian year 2233)\n *\n * Due to drift, this will eventually slip into Iyyar\n * - 2 Iyyar 7141 (Gregorian year 3381)\n * @private\n */\nfunction getBirkatHaChama(year: number): number {\n const leap = HDate.isLeapYear(year);\n const startMonth = leap ? ADAR_II : NISAN;\n const startDay = leap ? 20 : 1;\n const baseRd = HDate.hebrew2abs(year, startMonth, startDay);\n for (let day = 0; day <= 40; day++) {\n const abs = baseRd + day;\n const elapsed = abs + 1373429;\n if (elapsed % 10227 === 172) {\n return abs;\n }\n }\n return 0;\n}\n\n/**\n * Returns a sorted array of holidays observed during the given Hebrew year,\n * filtered by Israel vs. Diaspora schedule.\n *\n * Includes Rosh Chodesh, fasts, special Shabbatot, modern holidays, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * Use {@link HebrewCalendar.calendar} for those.\n * @example\n * import {getHolidaysForYearArray} from '@hebcal/core';\n * const events = getHolidaysForYearArray(5784, false);\n * console.log(events[0].getDesc()); // 'Rosh Hashana 5784'\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\nexport function getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n const yearMap = getHolidaysForYear_(year);\n const startAbs = HDate.hebrew2abs(year, TISHREI, 1);\n const endAbs = HDate.hebrew2abs(year + 1, TISHREI, 1) - 1;\n let events: HolidayEvent[] = [];\n for (let absDt = startAbs; absDt <= endAbs; absDt++) {\n const hd = new HDate(absDt);\n const holidays = yearMap.get(hd.toString());\n if (holidays) {\n const filtered: HolidayEvent[] = holidays.filter(ev => ev.observedIn(il));\n events = events.concat(filtered);\n }\n }\n return events;\n}\n"],"names":["hdesc"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAoBH;;;;;;;;;;;;;;AAcG;AACG,SAAU,iBAAiB,CAC/B,IAA2B,EAC3B,EAAY,EAAA;IAEZ,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAI,IAAc,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC;AAClE,IAAA,MAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC3B,MAAM,OAAO,GAAG,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC;IACrD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;;IAEjC,IAAI,EAAE,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE;AAC5C,QAAA,OAAO,MAAM;IACf;AACA,IAAA,MAAM,QAAQ,GAAG,MAAM,C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,IAAA,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC;IACzD,IAAI,MAAM,GAAmB,EAAE;AAC/B,IAAA,KAAK,IAAI,KAAK,GAAG,QAAQ,EAAE,KAAK,IAAI,MAAM,EAAE,KAAK,EAAE,EAAE;AACnD,QAAA,MAAM,EAAE,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC;QAC3B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC;QAC3C,IAAI,QAAQ,EAAE;AACZ,YAAA,MAAM,QAAQ,GAAmB,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AACzE,YAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;QAClC;IACF;AACA,IAAA,OAAO,MAAM;AACf;;;;"}
|
|
1
|
+
{"version":3,"file":"holidays.js","sources":["../../../src/holidays.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 {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport {flags} from './event';\nimport {dateYomHaShoah, dateYomHaZikaron} from './modern';\nimport {getSedra} from './sedra';\nimport {\n staticHolidays,\n staticModernHolidays,\n holidayDesc as hdesc,\n} from './staticHolidays';\nimport {YomKippurKatanEvent} from './YomKippurKatanEvent';\nimport {\n HolidayEvent,\n ChanukahEvent,\n AsaraBTevetEvent,\n RoshHashanaEvent,\n RoshChodeshEvent,\n} from './HolidayEvent';\n\n/**\n * Returns an array of holiday Events that occur on the given date, or\n * `undefined` if no holidays occur that day.\n *\n * When `il` is omitted, both Diaspora-only and Israel-only events are\n * returned (e.g. on the second day of a Yom Tov, both `\"Pesach II\"` for\n * Diaspora and any Israel-only events). Pass `true` or `false` to filter\n * to a single schedule.\n * @example\n * import {getHolidaysOnDate, HDate, months} from '@hebcal/core';\n * const events = getHolidaysOnDate(new HDate(15, months.NISAN, 5784), false);\n * events?.map(ev => ev.getDesc()); // ['Pesach I']\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\nexport function getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n): HolidayEvent[] | undefined {\n const hd = HDate.isHDate(date) ? (date as HDate) : new HDate(date);\n const hdStr = hd.toString();\n const yearMap = getHolidaysForYear_(hd.getFullYear());\n const events = yearMap.get(hdStr);\n // if il isn't a boolean return both diaspora + IL for day\n if (il === undefined || events === undefined) {\n return events;\n }\n const filtered = events.filter(ev => ev.observedIn(il));\n return filtered;\n}\n\nconst CHAG = flags.CHAG;\nconst IL_ONLY = flags.IL_ONLY;\nconst LIGHT_CANDLES_TZEIS = flags.LIGHT_CANDLES_TZEIS;\nconst CHANUKAH_CANDLES = flags.CHANUKAH_CANDLES;\nconst BEHAB = flags.BEHAB;\nconst MINOR_FAST = flags.MINOR_FAST;\nconst SPECIAL_SHABBAT = flags.SPECIAL_SHABBAT;\nconst MODERN_HOLIDAY = flags.MODERN_HOLIDAY;\nconst MAJOR_FAST = flags.MAJOR_FAST;\nconst MINOR_HOLIDAY = flags.MINOR_HOLIDAY;\nconst EREV = flags.EREV;\n\nconst SUN = 0;\nconst TUE = 2;\nconst THU = 4;\nconst FRI = 5;\nconst SAT = 6;\n\nconst NISAN = months.NISAN;\nconst IYYAR = months.IYYAR;\nconst TAMUZ = months.TAMUZ;\nconst AV = months.AV;\nconst TISHREI = months.TISHREI;\nconst CHESHVAN = months.CHESHVAN;\nconst KISLEV = months.KISLEV;\nconst TEVET = months.TEVET;\nconst ADAR_I = months.ADAR_I;\nconst ADAR_II = months.ADAR_II;\n\nconst emojiIsraelFlag = {emoji: '🇮🇱'} as const;\n/**\n * Holidays for an entire Hebrew year, indexed by `HDate.toString()`\n * (e.g. `'15 Nisan 5784'`). Returned by\n * {@link HebrewCalendar.getHolidaysForYear}. Because a single date can carry\n * more than one event, each key maps to an array. Entries are *not* filtered\n * by Israel vs. Diaspora — inspect `flags.IL_ONLY` / `flags.CHUL_ONLY`.\n */\nexport type HolidayYearMap = Map<string, HolidayEvent[]>;\nconst yearCache = new QuickLRU<number, HolidayYearMap>({maxSize: 120});\n\n/**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`\n * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.\n * @private\n */\nexport function getHolidaysForYear_(year: number): HolidayYearMap {\n if (typeof year !== 'number') {\n throw new TypeError(`bad Hebrew year: ${year}`);\n }\n if (year < 1 || year > 32658) {\n throw new RangeError(`Hebrew year ${year} out of range 1-32658`);\n }\n const cached = yearCache.get(year);\n if (cached) {\n return cached;\n }\n\n const RH = new HDate(1, TISHREI, year);\n const pesach = new HDate(15, NISAN, year);\n\n const map = new Map<string, HolidayEvent[]>();\n function add(...events: HolidayEvent[]) {\n for (const ev of events) {\n const key = ev.date.toString();\n const arr = map.get(key);\n if (typeof arr === 'object') {\n if (arr[0].getFlags() & EREV) {\n arr.unshift(ev);\n } else {\n arr.push(ev);\n }\n } else {\n map.set(key, [ev]);\n }\n }\n }\n\n for (const h of staticHolidays) {\n const hd = new HDate(h.dd, h.mm, year);\n const attrs: any = {};\n if (h.emoji) attrs.emoji = h.emoji;\n if (h.chmDay) attrs.cholHaMoedDay = h.chmDay;\n const ev = new HolidayEvent(hd, h.desc, h.flags, attrs);\n add(ev);\n }\n\n // standard holidays that don't shift based on year\n add(new RoshHashanaEvent(RH, year, CHAG | LIGHT_CANDLES_TZEIS));\n\n // Variable date holidays\n const tzomGedaliahDay: number = RH.getDay() === THU ? 4 : 3;\n add(\n new HolidayEvent(\n new HDate(tzomGedaliahDay, TISHREI, year),\n hdesc.TZOM_GEDALIAH,\n MINOR_FAST\n )\n );\n // first SAT after RH\n add(\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, 7 + RH.abs())),\n hdesc.SHABBAT_SHUVA,\n SPECIAL_SHABBAT\n )\n );\n const rchTevet = HDate.shortKislev(year)\n ? new HDate(1, TEVET, year)\n : new HDate(30, KISLEV, year);\n add(new HolidayEvent(rchTevet, hdesc.CHAG_HABANOT, MINOR_HOLIDAY));\n add(\n new ChanukahEvent(\n new HDate(24, KISLEV, year),\n hdesc.CHANUKAH_1_CANDLE,\n EREV | MINOR_HOLIDAY | CHANUKAH_CANDLES,\n undefined\n )\n );\n // yes, we know Kislev 30-32 are wrong\n // HDate() corrects the month automatically\n for (let candles = 2; candles <= 8; candles++) {\n const hd = new HDate(23 + candles, KISLEV, year);\n add(\n new ChanukahEvent(\n hd,\n `Chanukah: ${candles} Candles`,\n MINOR_HOLIDAY | CHANUKAH_CANDLES,\n candles - 1\n )\n );\n }\n add(\n new ChanukahEvent(\n new HDate(32, KISLEV, year),\n hdesc.CHANUKAH_8TH_DAY,\n MINOR_HOLIDAY,\n 8\n )\n );\n add(\n new AsaraBTevetEvent(new HDate(10, TEVET, year), hdesc.ASARA_BTEVET, MINOR_FAST)\n );\n const pesachAbs = pesach.abs();\n add(\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 43)),\n hdesc.SHABBAT_SHEKALIM,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 30)),\n hdesc.SHABBAT_ZACHOR,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(pesachAbs - (pesach.getDay() === TUE ? 33 : 31)),\n hdesc.TAANIT_ESTHER,\n MINOR_FAST\n )\n );\n const haChodeshAbs = HDate.dayOnOrBefore(SAT, pesachAbs - 14);\n add(\n new HolidayEvent(\n new HDate(haChodeshAbs - 7),\n hdesc.SHABBAT_PARAH,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(haChodeshAbs),\n hdesc.SHABBAT_HACHODESH,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 1)),\n hdesc.SHABBAT_HAGADOL,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n // if the fast falls on Shabbat, move to Thursday\n pesach.prev().getDay() === SAT\n ? pesach.onOrBefore(THU)\n : new HDate(14, NISAN, year),\n hdesc.TAANIT_BECHOROT,\n MINOR_FAST\n )\n );\n add(\n new HolidayEvent(\n new HDate(\n HDate.dayOnOrBefore(SAT, new HDate(1, TISHREI, year + 1).abs() - 4)\n ),\n hdesc.LEIL_SELICHOT,\n MINOR_HOLIDAY,\n {emoji: '🕍'}\n )\n );\n\n if (pesach.getDay() === SUN) {\n add(\n new HolidayEvent(\n new HDate(16, ADAR_II, year),\n hdesc.PURIM_MESHULASH,\n MINOR_HOLIDAY\n )\n );\n }\n\n if (HDate.isLeapYear(year)) {\n add(\n new HolidayEvent(\n new HDate(14, ADAR_I, year),\n hdesc.PURIM_KATAN,\n MINOR_HOLIDAY,\n {emoji: '🎭️'}\n )\n );\n add(\n new HolidayEvent(\n new HDate(15, ADAR_I, year),\n hdesc.SHUSHAN_PURIM_KATAN,\n MINOR_HOLIDAY,\n {emoji: '🎭️'}\n )\n );\n }\n\n const nisan27dt = dateYomHaShoah(year);\n if (nisan27dt) {\n add(new HolidayEvent(nisan27dt, hdesc.YOM_HASHOAH, MODERN_HOLIDAY));\n }\n\n const yomHaZikaronDt = dateYomHaZikaron(year);\n if (yomHaZikaronDt) {\n add(\n new HolidayEvent(\n yomHaZikaronDt,\n hdesc.YOM_HAZIKARON,\n MODERN_HOLIDAY,\n emojiIsraelFlag\n ),\n new HolidayEvent(\n yomHaZikaronDt.next(),\n hdesc.YOM_HAATZMA_UT,\n MODERN_HOLIDAY,\n emojiIsraelFlag\n )\n );\n }\n\n for (const h of staticModernHolidays) {\n if (year >= h.firstYear) {\n let hd = new HDate(h.dd, h.mm, year);\n const dow = hd.getDay();\n if (h.friSatMovetoThu && (dow === FRI || dow === SAT)) {\n hd = hd.onOrBefore(THU);\n } else if (h.friPostponeToSun && dow === FRI) {\n hd = new HDate(hd.abs() + 2);\n } else if (h.satPostponeToSun && dow === SAT) {\n hd = hd.next();\n }\n const mask = h.chul ? MODERN_HOLIDAY : MODERN_HOLIDAY | IL_ONLY;\n const ev = new HolidayEvent(hd, h.desc, mask);\n if (!h.suppressEmoji) {\n ev.emoji = '🇮🇱';\n }\n add(ev);\n }\n }\n\n let tamuz17 = new HDate(17, TAMUZ, year);\n let tamuz17attrs;\n if (tamuz17.getDay() === SAT) {\n tamuz17 = new HDate(18, TAMUZ, year);\n tamuz17attrs = {observed: true};\n }\n add(new HolidayEvent(tamuz17, hdesc.TZOM_TAMMUZ, MINOR_FAST, tamuz17attrs));\n\n let av9dt = new HDate(9, AV, year);\n let av9title = hdesc.TISHA_BAV;\n let av9attrs;\n if (av9dt.getDay() === SAT) {\n av9dt = av9dt.next();\n av9attrs = {observed: true};\n av9title += ' (observed)';\n }\n const av9abs = av9dt.abs();\n add(\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, av9abs)),\n hdesc.SHABBAT_CHAZON,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n av9dt.prev(),\n hdesc.EREV_TISHA_BAV,\n EREV | MAJOR_FAST,\n av9attrs\n ),\n new HolidayEvent(av9dt, av9title, MAJOR_FAST, av9attrs),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, av9abs + 7)),\n hdesc.SHABBAT_NACHAMU,\n SPECIAL_SHABBAT\n )\n );\n\n const monthsInYear = HDate.monthsInYear(year);\n for (let month = 1; month <= monthsInYear; month++) {\n const monthName = HDate.getMonthName(month, year);\n if (\n (month === NISAN\n ? HDate.daysInMonth(HDate.monthsInYear(year - 1), year - 1)\n : HDate.daysInMonth(month - 1, year)) === 30\n ) {\n add(new RoshChodeshEvent(new HDate(1, month, year), monthName));\n add(new RoshChodeshEvent(new HDate(30, month - 1, year), monthName));\n } else if (month !== TISHREI) {\n add(new RoshChodeshEvent(new HDate(1, month, year), monthName));\n }\n }\n\n // Begin: Yom Kippur Katan\n // start at Iyyar because one may not fast during Nisan\n for (let month = months.IYYAR; month <= monthsInYear; month++) {\n const nextMonth = month + 1;\n // Yom Kippur Katan is not observed on the day before Rosh Hashanah.\n // Not observed prior to Rosh Chodesh Cheshvan because Yom Kippur has just passed.\n // Not observed before Rosh Chodesh Tevet, because that day is Hanukkah.\n if (\n nextMonth === TISHREI ||\n nextMonth === months.CHESHVAN ||\n nextMonth === TEVET\n ) {\n continue;\n }\n let ykk = new HDate(29, month, year);\n const dow = ykk.getDay();\n if (dow === FRI || dow === SAT) {\n ykk = ykk.onOrBefore(THU);\n }\n\n const nextMonthName = HDate.getMonthName(nextMonth, year);\n const ev = new YomKippurKatanEvent(ykk, nextMonthName);\n add(ev);\n }\n\n for (const month of [CHESHVAN, IYYAR]) {\n const roshChodesh = new HDate(1, month, year);\n let shabbos = new HDate(HDate.dayOnOrBefore(SAT, roshChodesh.abs() + 6));\n if (shabbos.abs() === roshChodesh.abs()) {\n shabbos = new HDate(shabbos.abs() + 7);\n }\n const fastDays = [2, 5, 9].map(offset => new HDate(shabbos.abs() + offset));\n if (month === IYYAR && fastDays[2].getDate() === 14) {\n fastDays[2] = new HDate(17, IYYAR, year);\n }\n for (const hd of fastDays) {\n add(new HolidayEvent(hd, hdesc.TAANIT_BEHAB, MINOR_FAST | BEHAB));\n }\n }\n\n const sedra = getSedra(year, false);\n const beshalachHd = sedra.find(15) as HDate;\n add(new HolidayEvent(beshalachHd, hdesc.SHABBAT_SHIRAH, SPECIAL_SHABBAT));\n\n // Birkat Hachamah appears only once every 28 years\n const birkatHaChama = getBirkatHaChama(year);\n if (birkatHaChama) {\n const hd = new HDate(birkatHaChama);\n add(new HolidayEvent(hd, hdesc.BIRKAT_HACHAMAH, MINOR_HOLIDAY, {emoji: '☀️'}));\n }\n\n yearCache.set(year, map);\n return map;\n}\n\n/**\n * Birkat Hachamah appears only once every 28 years.\n * Although almost always in Nisan, it can occur in Adar II.\n * - 27 Adar II 5461 (Gregorian year 1701)\n * - 29 Adar II 5993 (Gregorian year 2233)\n *\n * Due to drift, this will eventually slip into Iyyar\n * - 2 Iyyar 7141 (Gregorian year 3381)\n * @private\n */\nfunction getBirkatHaChama(year: number): number {\n const leap = HDate.isLeapYear(year);\n const startMonth = leap ? ADAR_II : NISAN;\n const startDay = leap ? 20 : 1;\n const baseRd = HDate.hebrew2abs(year, startMonth, startDay);\n for (let day = 0; day <= 40; day++) {\n const abs = baseRd + day;\n const elapsed = abs + 1373429;\n if (elapsed % 10227 === 172) {\n return abs;\n }\n }\n return 0;\n}\n\n/**\n * Returns a sorted array of holidays observed during the given Hebrew year,\n * filtered by Israel vs. Diaspora schedule.\n *\n * Includes Rosh Chodesh, fasts, special Shabbatot, modern holidays, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * Use {@link calendar} for those.\n * @example\n * import {getHolidaysForYearArray} from '@hebcal/core';\n * const events = getHolidaysForYearArray(5784, false);\n * console.log(events[0].getDesc()); // 'Rosh Hashana 5784'\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\nexport function getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n const yearMap = getHolidaysForYear_(year);\n const startAbs = HDate.hebrew2abs(year, TISHREI, 1);\n const endAbs = HDate.hebrew2abs(year + 1, TISHREI, 1) - 1;\n let events: HolidayEvent[] = [];\n for (let absDt = startAbs; absDt <= endAbs; absDt++) {\n const hd = new HDate(absDt);\n const holidays = yearMap.get(hd.toString());\n if (holidays) {\n const filtered: HolidayEvent[] = holidays.filter(ev => ev.observedIn(il));\n events = events.concat(filtered);\n }\n }\n return events;\n}\n"],"names":["hdesc"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAoBH;;;;;;;;;;;;;;AAcG;AACG,SAAU,iBAAiB,CAC/B,IAA2B,EAC3B,EAAY,EAAA;IAEZ,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAI,IAAc,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC;AAClE,IAAA,MAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC3B,MAAM,OAAO,GAAG,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC;IACrD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;;IAEjC,IAAI,EAAE,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE;AAC5C,QAAA,OAAO,MAAM;IACf;AACA,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AACvD,IAAA,OAAO,QAAQ;AACjB;AAEA,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI;AACvB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO;AAC7B,MAAM,mBAAmB,GAAG,KAAK,CAAC,mBAAmB;AACrD,MAAM,gBAAgB,GAAG,KAAK,CAAC,gBAAgB;AAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK;AACzB,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU;AACnC,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe;AAC7C,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc;AAC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C,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AACzE,YAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;QAClC;IACF;AACA,IAAA,OAAO,MAAM;AACf;;;;"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -18,11 +18,13 @@ export { getMoladAsDate } from './moladDate';
|
|
|
18
18
|
export { Molad, MoladEvent } from './molad';
|
|
19
19
|
export { OmerEvent, OmerLang } from './omer';
|
|
20
20
|
export { TachanunResult, tachanun } from './tachanun';
|
|
21
|
-
export { Sedra, SedraResult, parshiot, getSedra } from './sedra';
|
|
21
|
+
export { Sedra, SedraResult, NumberOrString, parshiot, getSedra } from './sedra';
|
|
22
22
|
export { ParshaEvent } from './ParshaEvent';
|
|
23
23
|
export { parshaYear } from './parshaYear';
|
|
24
24
|
export { HolidayEvent, ChanukahEvent, AsaraBTevetEvent, RoshChodeshEvent, RoshHashanaEvent, } from './HolidayEvent';
|
|
25
25
|
export { HolidayYearMap, getHolidaysOnDate } from './holidays';
|
|
26
|
+
export { calendar } from './calendar';
|
|
27
|
+
export { reformatTimeStr } from './reformatTimeStr';
|
|
26
28
|
export { MevarchimChodeshEvent } from './MevarchimChodeshEvent';
|
|
27
29
|
export { YomKippurKatanEvent } from './YomKippurKatanEvent';
|
|
28
30
|
export { holidayDesc } from './staticHolidays';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.9.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
export { version } from './pkgVersion.js';
|
|
3
3
|
export { HDate, Locale, gematriya, gematriyaStrToNum, greg, months } from '@hebcal/hdate';
|
|
4
4
|
import './locale.js';
|
|
@@ -22,6 +22,8 @@ export { ParshaEvent } from './ParshaEvent.js';
|
|
|
22
22
|
export { parshaYear } from './parshaYear.js';
|
|
23
23
|
export { AsaraBTevetEvent, ChanukahEvent, HolidayEvent, RoshChodeshEvent, RoshHashanaEvent } from './HolidayEvent.js';
|
|
24
24
|
export { getHolidaysOnDate } from './holidays.js';
|
|
25
|
+
export { calendar } from './calendar.js';
|
|
26
|
+
export { reformatTimeStr } from './reformatTimeStr.js';
|
|
25
27
|
export { MevarchimChodeshEvent } from './MevarchimChodeshEvent.js';
|
|
26
28
|
export { YomKippurKatanEvent } from './YomKippurKatanEvent.js';
|
|
27
29
|
export { holidayDesc } from './staticHolidays.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v6.
|
|
1
|
+
/*! @hebcal/core v6.9.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { getPseudoISO, HDate } from '@hebcal/hdate';
|
|
3
3
|
import { Zmanim } from './zmanim.js';
|
|
4
4
|
import { getHolidaysOnDate } from './holidays.js';
|
|
@@ -16,9 +16,12 @@ function isTomorrowShabbosOrYomTov(dow, events) {
|
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* Returns true if it is
|
|
19
|
+
* Returns true if it is _Shabbos_ or if it is a _Yom Tov_ day that has a
|
|
20
|
+
* _melacha_ (work) prohibition.
|
|
20
21
|
*
|
|
21
|
-
* @
|
|
22
|
+
* @param dow day of week, where `6` is Shabbos
|
|
23
|
+
* @param events events occurring on the day
|
|
24
|
+
* @return `true` if the day is a _Yom Tov_ that is _assur bemlacha_, or _Shabbos_
|
|
22
25
|
*/
|
|
23
26
|
function isTodayAssurBemelacha(dow, events) {
|
|
24
27
|
if (dow === 6) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isAssurBemlacha.js","sources":["../../../src/isAssurBemlacha.ts"],"sourcesContent":["import {HDate, getPseudoISO} from '@hebcal/hdate';\nimport {Zmanim} from './zmanim';\nimport {Location} from './location';\nimport {getHolidaysOnDate} from './holidays';\nimport {Event, flags} from './event';\n\nconst LIGHT_CANDLES = flags.LIGHT_CANDLES | flags.LIGHT_CANDLES_TZEIS;\n\nfunction isTomorrowShabbosOrYomTov(dow: number, events: Event[]): boolean {\n if (dow === 5) {\n return true;\n }\n const erev = events.find(ev => ev.getFlags() & LIGHT_CANDLES);\n if (erev) {\n return true;\n }\n return false;\n}\n\n/**\n * Returns true if it is
|
|
1
|
+
{"version":3,"file":"isAssurBemlacha.js","sources":["../../../src/isAssurBemlacha.ts"],"sourcesContent":["import {HDate, getPseudoISO} from '@hebcal/hdate';\nimport {Zmanim} from './zmanim';\nimport {Location} from './location';\nimport {getHolidaysOnDate} from './holidays';\nimport {Event, flags} from './event';\n\nconst LIGHT_CANDLES = flags.LIGHT_CANDLES | flags.LIGHT_CANDLES_TZEIS;\n\nfunction isTomorrowShabbosOrYomTov(dow: number, events: Event[]): boolean {\n if (dow === 5) {\n return true;\n }\n const erev = events.find(ev => ev.getFlags() & LIGHT_CANDLES);\n if (erev) {\n return true;\n }\n return false;\n}\n\n/**\n * Returns true if it is _Shabbos_ or if it is a _Yom Tov_ day that has a\n * _melacha_ (work) prohibition.\n *\n * @param dow day of week, where `6` is Shabbos\n * @param events events occurring on the day\n * @return `true` if the day is a _Yom Tov_ that is _assur bemlacha_, or _Shabbos_\n */\nfunction isTodayAssurBemelacha(dow: number, events: Event[]): boolean {\n if (dow === 6) {\n return true;\n }\n const chag = events.find(ev => ev.getFlags() & flags.CHAG);\n if (chag) {\n return true;\n }\n return false;\n}\n\n/**\n * Returns `true` if the given moment (date + time) falls within a period\n * when *melacha* (work) is prohibited — i.e. Shabbat or a Yom Tov.\n *\n * The Shabbat/Yom Tov window is taken to begin at sunset (shkiah) on the\n * preceding day (Erev Shabbat / Erev Yom Tov / Yom Tov sheni) and to end\n * at *tzais* (nightfall) on the day itself. *Tzais* is calculated using a\n * solar depression of 8.5° for simplicity; consult a halachic authority\n * for more stringent opinions.\n *\n * `useElevation` controls whether the location's elevation is taken into\n * account when computing sunset (it has no effect on the degree-based\n * tzais calculation). The Israel/Diaspora schedule comes from\n * `location.getIsrael()`.\n *\n * Throws if sunset cannot be calculated for the given location\n * (e.g. polar regions).\n * @example\n * import {isAssurBemlacha, Location} from '@hebcal/core';\n * const loc = Location.lookup('Jerusalem')!;\n * // Friday after sunset:\n * isAssurBemlacha(new Date('2024-04-26T18:00:00Z'), loc, false); // true\n * @param currentTime the moment to test (with hour/minute)\n * @param location geographic location (also supplies Israel/Diaspora flag and tzid)\n * @param useElevation include elevation when computing sunset\n * @return `true` if *melacha* is prohibited, `false` if it is not\n */\nexport function isAssurBemlacha(\n currentTime: Date,\n location: Location,\n useElevation: boolean\n): boolean {\n // Determine the calendar date in the location's timezone, not the\n // timezone of the computer running this code. Otherwise the day-of-week,\n // Hebrew date and sunset/tzais times would depend on the machine's\n // local timezone, giving different (incorrect) results near midnight.\n const isoDate = getPseudoISO(location.getTzid(), currentTime);\n const year = parseInt(isoDate.substring(0, 4), 10);\n const month = parseInt(isoDate.substring(5, 7), 10);\n const day = parseInt(isoDate.substring(8, 10), 10);\n const hd = new HDate(new Date(year, month - 1, day));\n const zmanim = new Zmanim(location, hd, useElevation);\n // erev shabbos, YT or YT sheni and after shkiah\n const sunset = zmanim.sunset();\n const sunsetMillis = sunset.getTime();\n if (isNaN(sunsetMillis)) {\n throw new Error('Could not determine sunset');\n }\n // erev shabbos, YT or YT sheni and after shkiah\n const il = location.getIsrael();\n const currentMillis = currentTime.getTime();\n const dow = hd.getDay();\n const events = getHolidaysOnDate(hd, il) || [];\n if (isTomorrowShabbosOrYomTov(dow, events) && currentMillis >= sunsetMillis) {\n return true;\n }\n // is shabbos or YT and it is before tzais\n if (isTodayAssurBemelacha(dow, events)) {\n const tzais = zmanim.tzeit();\n const tzaisMillis = tzais.getTime();\n return currentMillis <= tzaisMillis;\n }\n return false;\n}\n"],"names":[],"mappings":";;;;;;AAMA,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,mBAAmB;AAErE,SAAS,yBAAyB,CAAC,GAAW,EAAE,MAAe,EAAA;AAC7D,IAAA,IAAI,GAAG,KAAK,CAAC,EAAE;AACb,QAAA,OAAO,IAAI;IACb;AACA,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,GAAG,aAAa,CAAC;IAC7D,IAAI,IAAI,EAAE;AACR,QAAA,OAAO,IAAI;IACb;AACA,IAAA,OAAO,KAAK;AACd;AAEA;;;;;;;AAOG;AACH,SAAS,qBAAqB,CAAC,GAAW,EAAE,MAAe,EAAA;AACzD,IAAA,IAAI,GAAG,KAAK,CAAC,EAAE;AACb,QAAA,OAAO,IAAI;IACb;AACA,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IAC1D,IAAI,IAAI,EAAE;AACR,QAAA,OAAO,IAAI;IACb;AACA,IAAA,OAAO,KAAK;AACd;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;SACa,eAAe,CAC7B,WAAiB,EACjB,QAAkB,EAClB,YAAqB,EAAA;;;;;IAMrB,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC;AAC7D,IAAA,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;AAClD,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,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@hebcal/hdate';
|
|
|
15
15
|
* isFastDay(new HDate(10, months.TISHREI, 5784)); // true (Yom Kippur)
|
|
16
16
|
* isFastDay(new HDate(11, months.TISHREI, 5784)); // false
|
|
17
17
|
* @param date Hebrew Date, Gregorian date, or absolute R.D. day number
|
|
18
|
-
* @param il use the Israeli schedule for holidays
|
|
18
|
+
* @param il optional; use the Israeli schedule for holidays (default Diaspora)
|
|
19
19
|
* @return `true` if the date is a major or minor fast day
|
|
20
20
|
*/
|
|
21
21
|
export declare function isFastDay(date: HDate | Date | number, il?: boolean): boolean;
|