@hebcal/core 5.6.1 → 5.7.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 +23 -1
- package/dist/CalOptions.d.ts +1 -1
- package/dist/HolidayEvent.d.ts +0 -5
- package/dist/YomKippurKatanEvent.d.ts +0 -1
- package/dist/bundle.js +9733 -9579
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +2 -2
- package/dist/bundle.min.js.map +1 -1
- package/dist/calendar.d.ts +110 -0
- package/dist/candles.d.ts +9 -1
- package/dist/es/CalOptions.d.ts +158 -0
- package/dist/es/DailyLearning.d.ts +21 -0
- package/dist/es/DailyLearning.js +36 -0
- package/dist/es/DailyLearning.js.map +1 -0
- package/dist/es/HebrewDateEvent.d.ts +37 -0
- package/dist/es/HebrewDateEvent.js +77 -0
- package/dist/es/HebrewDateEvent.js.map +1 -0
- package/dist/es/HolidayEvent.d.ts +76 -0
- package/dist/es/HolidayEvent.js +165 -0
- package/dist/es/HolidayEvent.js.map +1 -0
- package/dist/es/MevarchimChodeshEvent.d.ts +25 -0
- package/dist/es/MevarchimChodeshEvent.js +54 -0
- package/dist/es/MevarchimChodeshEvent.js.map +1 -0
- package/dist/es/ParshaEvent.d.ts +23 -0
- package/dist/es/ParshaEvent.js +53 -0
- package/dist/es/ParshaEvent.js.map +1 -0
- package/dist/es/TimedEvent.d.ts +47 -0
- package/dist/es/TimedEvent.js +97 -0
- package/dist/es/TimedEvent.js.map +1 -0
- package/dist/es/YomKippurKatanEvent.d.ts +23 -0
- package/dist/es/YomKippurKatanEvent.js +43 -0
- package/dist/es/YomKippurKatanEvent.js.map +1 -0
- package/dist/es/ashkenazi.po.d.ts +67 -0
- package/dist/es/ashkenazi.po.js +5 -0
- package/dist/es/ashkenazi.po.js.map +1 -0
- package/dist/es/calendar.d.ts +110 -0
- package/dist/es/calendar.js +615 -0
- package/dist/es/calendar.js.map +1 -0
- package/dist/es/candles.d.ts +36 -0
- package/dist/es/candles.js +154 -0
- package/dist/es/candles.js.map +1 -0
- package/dist/es/event.d.ts +187 -0
- package/dist/es/event.js +243 -0
- package/dist/es/event.js.map +1 -0
- package/dist/es/getStartAndEnd.d.ts +6 -0
- package/dist/es/getStartAndEnd.js +102 -0
- package/dist/es/getStartAndEnd.js.map +1 -0
- package/dist/es/hallel.d.ts +6 -0
- package/dist/es/hallel.js +52 -0
- package/dist/es/hallel.js.map +1 -0
- package/dist/es/he.po.d.ts +246 -0
- package/dist/es/he.po.js +5 -0
- package/dist/es/he.po.js.map +1 -0
- package/dist/es/hebcal.d.ts +259 -0
- package/dist/es/hebcal.js +336 -0
- package/dist/es/hebcal.js.map +1 -0
- package/dist/es/holidays.d.ts +22 -0
- package/dist/es/holidays.js +321 -0
- package/dist/es/holidays.js.map +1 -0
- package/dist/es/index.d.ts +23 -0
- package/dist/es/index.js +22 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/locale.d.ts +1 -0
- package/dist/es/locale.js +21 -0
- package/dist/es/locale.js.map +1 -0
- package/dist/es/location.d.ts +73 -0
- package/dist/es/location.js +306 -0
- package/dist/es/location.js.map +1 -0
- package/dist/es/modern.d.ts +18 -0
- package/dist/es/modern.js +64 -0
- package/dist/es/modern.js.map +1 -0
- package/dist/es/molad.d.ts +62 -0
- package/dist/es/molad.js +141 -0
- package/dist/es/molad.js.map +1 -0
- package/dist/es/omer.d.ts +37 -0
- package/dist/es/omer.js +88 -0
- package/dist/es/omer.js.map +1 -0
- package/dist/es/parshaName.d.ts +3 -0
- package/dist/es/parshaName.js +19 -0
- package/dist/es/parshaName.js.map +1 -0
- package/dist/es/pkgVersion.d.ts +2 -0
- package/dist/es/pkgVersion.js +6 -0
- package/dist/es/pkgVersion.js.map +1 -0
- package/dist/es/reformatTimeStr.d.ts +8 -0
- package/dist/es/reformatTimeStr.js +52 -0
- package/dist/es/reformatTimeStr.js.map +1 -0
- package/dist/es/sedra.d.ts +107 -0
- package/dist/es/sedra.js +494 -0
- package/dist/es/sedra.js.map +1 -0
- package/dist/es/staticHolidays.d.ts +176 -0
- package/dist/es/staticHolidays.js +626 -0
- package/dist/es/staticHolidays.js.map +1 -0
- package/dist/es/tachanun.d.ts +29 -0
- package/dist/es/tachanun.js +125 -0
- package/dist/es/tachanun.js.map +1 -0
- package/dist/es/zmanim.d.ts +341 -0
- package/dist/es/zmanim.js +573 -0
- package/dist/es/zmanim.js.map +1 -0
- package/dist/event.d.ts +1 -0
- package/dist/holidays.d.ts +13 -0
- package/dist/index.cjs +2755 -10041
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/module.d.ts +100 -80
- package/dist/pkgVersion.d.ts +1 -1
- package/dist/sedra.d.ts +4 -4
- package/dist/tachanun.d.ts +17 -1
- package/package.json +18 -6
- package/dist/index.mjs +0 -11998
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/*! @hebcal/core v5.7.0 */
|
|
2
|
+
import { months, HDate } from '@hebcal/hdate';
|
|
3
|
+
import QuickLRU from 'quick-lru';
|
|
4
|
+
import { flags } from './event.js';
|
|
5
|
+
import { dateYomHaShoah, dateYomHaZikaron } from './modern.js';
|
|
6
|
+
import { getSedra } from './sedra.js';
|
|
7
|
+
import { staticHolidays, holidayDesc, staticModernHolidays } from './staticHolidays.js';
|
|
8
|
+
import { YomKippurKatanEvent } from './YomKippurKatanEvent.js';
|
|
9
|
+
import { HolidayEvent, RoshHashanaEvent, AsaraBTevetEvent, RoshChodeshEvent } from './HolidayEvent.js';
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
Hebcal - A Jewish Calendar Generator
|
|
13
|
+
Copyright (c) 1994-2020 Danny Sadinoff
|
|
14
|
+
Portions copyright Eyal Schachter and Michael J. Radwin
|
|
15
|
+
|
|
16
|
+
https://github.com/hebcal/hebcal-es6
|
|
17
|
+
|
|
18
|
+
This program is free software; you can redistribute it and/or
|
|
19
|
+
modify it under the terms of the GNU General Public License
|
|
20
|
+
as published by the Free Software Foundation; either version 2
|
|
21
|
+
of the License, or (at your option) any later version.
|
|
22
|
+
|
|
23
|
+
This program is distributed in the hope that it will be useful,
|
|
24
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
25
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
26
|
+
GNU General Public License for more details.
|
|
27
|
+
|
|
28
|
+
You should have received a copy of the GNU General Public License
|
|
29
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
30
|
+
*/
|
|
31
|
+
/** @private */
|
|
32
|
+
function observedInIsrael(ev) {
|
|
33
|
+
return ev.observedInIsrael();
|
|
34
|
+
}
|
|
35
|
+
/** @private */
|
|
36
|
+
function observedInDiaspora(ev) {
|
|
37
|
+
return ev.observedInDiaspora();
|
|
38
|
+
}
|
|
39
|
+
/** @private */
|
|
40
|
+
function holidayFilter(il) {
|
|
41
|
+
return il ? observedInIsrael : observedInDiaspora;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Returns an array of Events on this date (or `undefined` if no events)
|
|
45
|
+
* @param date Hebrew Date, Gregorian date, or absolute R.D. day number
|
|
46
|
+
* @param [il] use the Israeli schedule for holidays
|
|
47
|
+
*/
|
|
48
|
+
function getHolidaysOnDate(date, il) {
|
|
49
|
+
const hd = HDate.isHDate(date) ? date : new HDate(date);
|
|
50
|
+
const hdStr = hd.toString();
|
|
51
|
+
const yearMap = getHolidaysForYear_(hd.getFullYear());
|
|
52
|
+
const events = yearMap.get(hdStr);
|
|
53
|
+
// if il isn't a boolean return both diaspora + IL for day
|
|
54
|
+
if (typeof il === 'undefined' || typeof events === 'undefined') {
|
|
55
|
+
return events;
|
|
56
|
+
}
|
|
57
|
+
const filtered = events.filter(holidayFilter(il));
|
|
58
|
+
return filtered;
|
|
59
|
+
}
|
|
60
|
+
const CHAG = flags.CHAG;
|
|
61
|
+
const IL_ONLY = flags.IL_ONLY;
|
|
62
|
+
const LIGHT_CANDLES_TZEIS = flags.LIGHT_CANDLES_TZEIS;
|
|
63
|
+
const CHANUKAH_CANDLES = flags.CHANUKAH_CANDLES;
|
|
64
|
+
const MINOR_FAST = flags.MINOR_FAST;
|
|
65
|
+
const SPECIAL_SHABBAT = flags.SPECIAL_SHABBAT;
|
|
66
|
+
const MODERN_HOLIDAY = flags.MODERN_HOLIDAY;
|
|
67
|
+
const MAJOR_FAST = flags.MAJOR_FAST;
|
|
68
|
+
const MINOR_HOLIDAY = flags.MINOR_HOLIDAY;
|
|
69
|
+
const EREV = flags.EREV;
|
|
70
|
+
const SUN = 0;
|
|
71
|
+
const TUE = 2;
|
|
72
|
+
const THU = 4;
|
|
73
|
+
const FRI = 5;
|
|
74
|
+
const SAT = 6;
|
|
75
|
+
const NISAN = months.NISAN;
|
|
76
|
+
const TAMUZ = months.TAMUZ;
|
|
77
|
+
const AV = months.AV;
|
|
78
|
+
const TISHREI = months.TISHREI;
|
|
79
|
+
const KISLEV = months.KISLEV;
|
|
80
|
+
const TEVET = months.TEVET;
|
|
81
|
+
const ADAR_I = months.ADAR_I;
|
|
82
|
+
const ADAR_II = months.ADAR_II;
|
|
83
|
+
const emojiIsraelFlag = { emoji: '🇮🇱' };
|
|
84
|
+
const chanukahEmoji = '🕎';
|
|
85
|
+
const yearCache = new QuickLRU({ maxSize: 400 });
|
|
86
|
+
const KEYCAP_DIGITS = [
|
|
87
|
+
'0️⃣',
|
|
88
|
+
'1️⃣',
|
|
89
|
+
'2️⃣',
|
|
90
|
+
'3️⃣',
|
|
91
|
+
'4️⃣',
|
|
92
|
+
'5️⃣',
|
|
93
|
+
'6️⃣',
|
|
94
|
+
'7️⃣',
|
|
95
|
+
'8️⃣',
|
|
96
|
+
'9️⃣',
|
|
97
|
+
];
|
|
98
|
+
/**
|
|
99
|
+
* Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
|
|
100
|
+
* `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`
|
|
101
|
+
* or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.
|
|
102
|
+
* @private
|
|
103
|
+
*/
|
|
104
|
+
function getHolidaysForYear_(year) {
|
|
105
|
+
if (typeof year !== 'number') {
|
|
106
|
+
throw new TypeError(`bad Hebrew year: ${year}`);
|
|
107
|
+
}
|
|
108
|
+
else if (year < 1 || year > 32658) {
|
|
109
|
+
throw new RangeError(`Hebrew year ${year} out of range 1-32658`);
|
|
110
|
+
}
|
|
111
|
+
const cached = yearCache.get(year);
|
|
112
|
+
if (cached) {
|
|
113
|
+
return cached;
|
|
114
|
+
}
|
|
115
|
+
const RH = new HDate(1, TISHREI, year);
|
|
116
|
+
const pesach = new HDate(15, NISAN, year);
|
|
117
|
+
const map = new Map();
|
|
118
|
+
function add(...events) {
|
|
119
|
+
for (const ev of events) {
|
|
120
|
+
const key = ev.date.toString();
|
|
121
|
+
const arr = map.get(key);
|
|
122
|
+
if (typeof arr === 'object') {
|
|
123
|
+
if (arr[0].getFlags() & EREV) {
|
|
124
|
+
arr.unshift(ev);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
arr.push(ev);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
map.set(key, [ev]);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
for (const h of staticHolidays) {
|
|
136
|
+
const hd = new HDate(h.dd, h.mm, year);
|
|
137
|
+
const ev = new HolidayEvent(hd, h.desc, h.flags);
|
|
138
|
+
if (h.emoji)
|
|
139
|
+
ev.emoji = h.emoji;
|
|
140
|
+
if (h.chmDay)
|
|
141
|
+
ev.cholHaMoedDay = h.chmDay;
|
|
142
|
+
add(ev);
|
|
143
|
+
}
|
|
144
|
+
// standard holidays that don't shift based on year
|
|
145
|
+
add(new RoshHashanaEvent(RH, year, CHAG | LIGHT_CANDLES_TZEIS));
|
|
146
|
+
// Variable date holidays
|
|
147
|
+
const tzomGedaliahDay = RH.getDay() === THU ? 4 : 3;
|
|
148
|
+
add(new HolidayEvent(new HDate(tzomGedaliahDay, TISHREI, year), holidayDesc.TZOM_GEDALIAH, MINOR_FAST));
|
|
149
|
+
// first SAT after RH
|
|
150
|
+
add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, 7 + RH.abs())), holidayDesc.SHABBAT_SHUVA, SPECIAL_SHABBAT));
|
|
151
|
+
const rchTevet = HDate.shortKislev(year)
|
|
152
|
+
? new HDate(1, TEVET, year)
|
|
153
|
+
: new HDate(30, KISLEV, year);
|
|
154
|
+
add(new HolidayEvent(rchTevet, holidayDesc.CHAG_HABANOT, MINOR_HOLIDAY));
|
|
155
|
+
// yes, we know Kislev 30-32 are wrong
|
|
156
|
+
// HDate() corrects the month automatically
|
|
157
|
+
for (let candles = 2; candles <= 8; candles++) {
|
|
158
|
+
const hd = new HDate(23 + candles, KISLEV, year);
|
|
159
|
+
add(new HolidayEvent(hd, `Chanukah: ${candles} Candles`, MINOR_HOLIDAY | CHANUKAH_CANDLES, {
|
|
160
|
+
chanukahDay: candles - 1,
|
|
161
|
+
emoji: chanukahEmoji + KEYCAP_DIGITS[candles],
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
add(new HolidayEvent(new HDate(32, KISLEV, year), holidayDesc.CHANUKAH_8TH_DAY, MINOR_HOLIDAY, { chanukahDay: 8, emoji: chanukahEmoji }));
|
|
165
|
+
add(new AsaraBTevetEvent(new HDate(10, TEVET, year), holidayDesc.ASARA_BTEVET, MINOR_FAST));
|
|
166
|
+
const pesachAbs = pesach.abs();
|
|
167
|
+
add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 43)), holidayDesc.SHABBAT_SHEKALIM, SPECIAL_SHABBAT), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 30)), holidayDesc.SHABBAT_ZACHOR, SPECIAL_SHABBAT), new HolidayEvent(new HDate(pesachAbs - (pesach.getDay() === TUE ? 33 : 31)), holidayDesc.TAANIT_ESTHER, MINOR_FAST));
|
|
168
|
+
const haChodeshAbs = HDate.dayOnOrBefore(SAT, pesachAbs - 14);
|
|
169
|
+
add(new HolidayEvent(new HDate(haChodeshAbs - 7), holidayDesc.SHABBAT_PARAH, SPECIAL_SHABBAT), new HolidayEvent(new HDate(haChodeshAbs), holidayDesc.SHABBAT_HACHODESH, SPECIAL_SHABBAT), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 1)), holidayDesc.SHABBAT_HAGADOL, SPECIAL_SHABBAT), new HolidayEvent(
|
|
170
|
+
// if the fast falls on Shabbat, move to Thursday
|
|
171
|
+
pesach.prev().getDay() === SAT
|
|
172
|
+
? pesach.onOrBefore(THU)
|
|
173
|
+
: new HDate(14, NISAN, year), holidayDesc.TAANIT_BECHOROT, MINOR_FAST));
|
|
174
|
+
add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, new HDate(1, TISHREI, year + 1).abs() - 4)), holidayDesc.LEIL_SELICHOT, MINOR_HOLIDAY, { emoji: '🕍' }));
|
|
175
|
+
if (pesach.getDay() === SUN) {
|
|
176
|
+
add(new HolidayEvent(new HDate(16, ADAR_II, year), holidayDesc.PURIM_MESHULASH, MINOR_HOLIDAY));
|
|
177
|
+
}
|
|
178
|
+
if (HDate.isLeapYear(year)) {
|
|
179
|
+
add(new HolidayEvent(new HDate(14, ADAR_I, year), holidayDesc.PURIM_KATAN, MINOR_HOLIDAY, { emoji: '🎭️' }));
|
|
180
|
+
add(new HolidayEvent(new HDate(15, ADAR_I, year), holidayDesc.SHUSHAN_PURIM_KATAN, MINOR_HOLIDAY, { emoji: '🎭️' }));
|
|
181
|
+
}
|
|
182
|
+
const nisan27dt = dateYomHaShoah(year);
|
|
183
|
+
if (nisan27dt) {
|
|
184
|
+
add(new HolidayEvent(nisan27dt, holidayDesc.YOM_HASHOAH, MODERN_HOLIDAY));
|
|
185
|
+
}
|
|
186
|
+
const yomHaZikaronDt = dateYomHaZikaron(year);
|
|
187
|
+
if (yomHaZikaronDt) {
|
|
188
|
+
add(new HolidayEvent(yomHaZikaronDt, holidayDesc.YOM_HAZIKARON, MODERN_HOLIDAY, emojiIsraelFlag), new HolidayEvent(yomHaZikaronDt.next(), holidayDesc.YOM_HAATZMA_UT, MODERN_HOLIDAY, emojiIsraelFlag));
|
|
189
|
+
}
|
|
190
|
+
for (const h of staticModernHolidays) {
|
|
191
|
+
if (year >= h.firstYear) {
|
|
192
|
+
let hd = new HDate(h.dd, h.mm, year);
|
|
193
|
+
const dow = hd.getDay();
|
|
194
|
+
if (h.friSatMovetoThu && (dow === FRI || dow === SAT)) {
|
|
195
|
+
hd = hd.onOrBefore(THU);
|
|
196
|
+
}
|
|
197
|
+
else if (h.friPostponeToSun && dow === FRI) {
|
|
198
|
+
hd = new HDate(hd.abs() + 2);
|
|
199
|
+
}
|
|
200
|
+
else if (h.satPostponeToSun && dow === SAT) {
|
|
201
|
+
hd = hd.next();
|
|
202
|
+
}
|
|
203
|
+
const mask = h.chul ? MODERN_HOLIDAY : MODERN_HOLIDAY | IL_ONLY;
|
|
204
|
+
const ev = new HolidayEvent(hd, h.desc, mask);
|
|
205
|
+
if (!h.suppressEmoji) {
|
|
206
|
+
ev.emoji = '🇮🇱';
|
|
207
|
+
}
|
|
208
|
+
add(ev);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
let tamuz17 = new HDate(17, TAMUZ, year);
|
|
212
|
+
let tamuz17attrs;
|
|
213
|
+
if (tamuz17.getDay() === SAT) {
|
|
214
|
+
tamuz17 = new HDate(18, TAMUZ, year);
|
|
215
|
+
tamuz17attrs = { observed: true };
|
|
216
|
+
}
|
|
217
|
+
add(new HolidayEvent(tamuz17, holidayDesc.TZOM_TAMMUZ, MINOR_FAST, tamuz17attrs));
|
|
218
|
+
let av9dt = new HDate(9, AV, year);
|
|
219
|
+
let av9title = holidayDesc.TISHA_BAV;
|
|
220
|
+
let av9attrs;
|
|
221
|
+
if (av9dt.getDay() === SAT) {
|
|
222
|
+
av9dt = av9dt.next();
|
|
223
|
+
av9attrs = { observed: true };
|
|
224
|
+
av9title += ' (observed)';
|
|
225
|
+
}
|
|
226
|
+
const av9abs = av9dt.abs();
|
|
227
|
+
add(new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, av9abs)), holidayDesc.SHABBAT_CHAZON, SPECIAL_SHABBAT), new HolidayEvent(av9dt.prev(), holidayDesc.EREV_TISHA_BAV, EREV | MAJOR_FAST, av9attrs), new HolidayEvent(av9dt, av9title, MAJOR_FAST, av9attrs), new HolidayEvent(new HDate(HDate.dayOnOrBefore(SAT, av9abs + 7)), holidayDesc.SHABBAT_NACHAMU, SPECIAL_SHABBAT));
|
|
228
|
+
const monthsInYear = HDate.monthsInYear(year);
|
|
229
|
+
for (let month = 1; month <= monthsInYear; month++) {
|
|
230
|
+
const monthName = HDate.getMonthName(month, year);
|
|
231
|
+
if ((month === NISAN
|
|
232
|
+
? HDate.daysInMonth(HDate.monthsInYear(year - 1), year - 1)
|
|
233
|
+
: HDate.daysInMonth(month - 1, year)) === 30) {
|
|
234
|
+
add(new RoshChodeshEvent(new HDate(1, month, year), monthName));
|
|
235
|
+
add(new RoshChodeshEvent(new HDate(30, month - 1, year), monthName));
|
|
236
|
+
}
|
|
237
|
+
else if (month !== TISHREI) {
|
|
238
|
+
add(new RoshChodeshEvent(new HDate(1, month, year), monthName));
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
// Begin: Yom Kippur Katan
|
|
242
|
+
// start at Iyyar because one may not fast during Nisan
|
|
243
|
+
for (let month = months.IYYAR; month <= monthsInYear; month++) {
|
|
244
|
+
const nextMonth = month + 1;
|
|
245
|
+
// Yom Kippur Katan is not observed on the day before Rosh Hashanah.
|
|
246
|
+
// Not observed prior to Rosh Chodesh Cheshvan because Yom Kippur has just passed.
|
|
247
|
+
// Not observed before Rosh Chodesh Tevet, because that day is Hanukkah.
|
|
248
|
+
if (nextMonth === TISHREI ||
|
|
249
|
+
nextMonth === months.CHESHVAN ||
|
|
250
|
+
nextMonth === TEVET) {
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
let ykk = new HDate(29, month, year);
|
|
254
|
+
const dow = ykk.getDay();
|
|
255
|
+
if (dow === FRI || dow === SAT) {
|
|
256
|
+
ykk = ykk.onOrBefore(THU);
|
|
257
|
+
}
|
|
258
|
+
const nextMonthName = HDate.getMonthName(nextMonth, year);
|
|
259
|
+
const ev = new YomKippurKatanEvent(ykk, nextMonthName);
|
|
260
|
+
add(ev);
|
|
261
|
+
}
|
|
262
|
+
const sedra = getSedra(year, false);
|
|
263
|
+
const beshalachHd = sedra.find(15);
|
|
264
|
+
add(new HolidayEvent(beshalachHd, holidayDesc.SHABBAT_SHIRAH, SPECIAL_SHABBAT));
|
|
265
|
+
// Birkat Hachamah appears only once every 28 years
|
|
266
|
+
const birkatHaChama = getBirkatHaChama(year);
|
|
267
|
+
if (birkatHaChama) {
|
|
268
|
+
const hd = new HDate(birkatHaChama);
|
|
269
|
+
add(new HolidayEvent(hd, holidayDesc.BIRKAT_HACHAMAH, MINOR_HOLIDAY, { emoji: '☀️' }));
|
|
270
|
+
}
|
|
271
|
+
yearCache.set(year, map);
|
|
272
|
+
return map;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Birkat Hachamah appears only once every 28 years.
|
|
276
|
+
* Although almost always in Nisan, it can occur in Adar II.
|
|
277
|
+
* - 27 Adar II 5461 (Gregorian year 1701)
|
|
278
|
+
* - 29 Adar II 5993 (Gregorian year 2233)
|
|
279
|
+
*
|
|
280
|
+
* Due to drift, this will eventually slip into Iyyar
|
|
281
|
+
* - 2 Iyyar 7141 (Gregorian year 3381)
|
|
282
|
+
* @private
|
|
283
|
+
*/
|
|
284
|
+
function getBirkatHaChama(year) {
|
|
285
|
+
const leap = HDate.isLeapYear(year);
|
|
286
|
+
const startMonth = leap ? ADAR_II : NISAN;
|
|
287
|
+
const startDay = leap ? 20 : 1;
|
|
288
|
+
const baseRd = HDate.hebrew2abs(year, startMonth, startDay);
|
|
289
|
+
for (let day = 0; day <= 40; day++) {
|
|
290
|
+
const abs = baseRd + day;
|
|
291
|
+
const elapsed = abs + 1373429;
|
|
292
|
+
if (elapsed % 10227 === 172) {
|
|
293
|
+
return abs;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return 0;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Returns an array of holidays for the year
|
|
300
|
+
* @param year Hebrew year
|
|
301
|
+
* @param il use the Israeli schedule for holidays
|
|
302
|
+
*/
|
|
303
|
+
function getHolidaysForYearArray(year, il) {
|
|
304
|
+
const yearMap = getHolidaysForYear_(year);
|
|
305
|
+
const startAbs = HDate.hebrew2abs(year, TISHREI, 1);
|
|
306
|
+
const endAbs = HDate.hebrew2abs(year + 1, TISHREI, 1) - 1;
|
|
307
|
+
let events = [];
|
|
308
|
+
const myFilter = il ? observedInIsrael : observedInDiaspora;
|
|
309
|
+
for (let absDt = startAbs; absDt <= endAbs; absDt++) {
|
|
310
|
+
const hd = new HDate(absDt);
|
|
311
|
+
const holidays = yearMap.get(hd.toString());
|
|
312
|
+
if (holidays) {
|
|
313
|
+
const filtered = holidays.filter(myFilter);
|
|
314
|
+
events = events.concat(filtered);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return events;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export { getHolidaysForYearArray, getHolidaysForYear_, getHolidaysOnDate };
|
|
321
|
+
//# sourceMappingURL=holidays.js.map
|
|
@@ -0,0 +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 {Event, 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 AsaraBTevetEvent,\n RoshHashanaEvent,\n RoshChodeshEvent,\n} from './HolidayEvent';\n\n/** @private */\nfunction observedInIsrael(ev: Event): boolean {\n return ev.observedInIsrael();\n}\n\n/** @private */\nfunction observedInDiaspora(ev: Event): boolean {\n return ev.observedInDiaspora();\n}\n\n/** @private */\nfunction holidayFilter(il: boolean) {\n return il ? observedInIsrael : observedInDiaspora;\n}\n\n/**\n * Returns an array of Events on this date (or `undefined` if no events)\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 (typeof il === 'undefined' || typeof events === 'undefined') {\n return events;\n }\n const filtered = events.filter(holidayFilter(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 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 TAMUZ = months.TAMUZ;\nconst AV = months.AV;\nconst TISHREI = months.TISHREI;\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;\nconst chanukahEmoji = '🕎';\nexport type HolidayYearMap = Map<string, HolidayEvent[]>;\nconst yearCache = new QuickLRU<number, HolidayYearMap>({maxSize: 400});\n\nconst KEYCAP_DIGITS = [\n '0️⃣',\n '1️⃣',\n '2️⃣',\n '3️⃣',\n '4️⃣',\n '5️⃣',\n '6️⃣',\n '7️⃣',\n '8️⃣',\n '9️⃣',\n] as const;\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 } else 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 ev = new HolidayEvent(hd, h.desc, h.flags);\n if (h.emoji) ev.emoji = h.emoji;\n if (h.chmDay) ev.cholHaMoedDay = h.chmDay;\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 // 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 HolidayEvent(\n hd,\n `Chanukah: ${candles} Candles`,\n MINOR_HOLIDAY | CHANUKAH_CANDLES,\n {\n chanukahDay: candles - 1,\n emoji: chanukahEmoji + KEYCAP_DIGITS[candles],\n }\n )\n );\n }\n add(\n new HolidayEvent(\n new HDate(32, KISLEV, year),\n hdesc.CHANUKAH_8TH_DAY,\n MINOR_HOLIDAY,\n {chanukahDay: 8, emoji: chanukahEmoji}\n )\n );\n add(\n new AsaraBTevetEvent(\n new HDate(10, TEVET, year),\n hdesc.ASARA_BTEVET,\n MINOR_FAST\n )\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 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(\n new HolidayEvent(hd, hdesc.BIRKAT_HACHAMAH, MINOR_HOLIDAY, {emoji: '☀️'})\n );\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 an array of holidays for the year\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\nexport function getHolidaysForYearArray(\n year: number,\n il: boolean\n): 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 const myFilter = il ? observedInIsrael : observedInDiaspora;\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(myFilter);\n events = events.concat(filtered);\n }\n }\n return events;\n}\n"],"names":["hdesc"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAmBH;AACA,SAAS,gBAAgB,CAAC,EAAS,EAAA;AACjC,IAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE;AAC9B;AAEA;AACA,SAAS,kBAAkB,CAAC,EAAS,EAAA;AACnC,IAAA,OAAO,EAAE,CAAC,kBAAkB,EAAE;AAChC;AAEA;AACA,SAAS,aAAa,CAAC,EAAW,EA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,OAAO,MAAM;AACf;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { version } from './pkgVersion';
|
|
2
|
+
export { gematriya, gematriyaStrToNum } from '@hebcal/hdate';
|
|
3
|
+
export { greg, months, HDate, Locale, Headers, StringArrayMap, LocaleData, } from '@hebcal/hdate';
|
|
4
|
+
import './locale';
|
|
5
|
+
export { CalOptions, DailyLearningValue } from './CalOptions';
|
|
6
|
+
export { HebrewDateEvent } from './HebrewDateEvent';
|
|
7
|
+
export { Event, flags } from './event';
|
|
8
|
+
export { GeoLocation, NOAACalculator } from '@hebcal/noaa';
|
|
9
|
+
export { Location } from './location';
|
|
10
|
+
export { Zmanim } from './zmanim';
|
|
11
|
+
export { TimedEvent, CandleLightingEvent, HavdalahEvent } from './TimedEvent';
|
|
12
|
+
export { FastDayEvent } from './candles';
|
|
13
|
+
export { Molad, MoladEvent } from './molad';
|
|
14
|
+
export { OmerEvent } from './omer';
|
|
15
|
+
export { TachanunResult } from './tachanun';
|
|
16
|
+
export { Sedra, SedraResult, parshiot, getSedra } from './sedra';
|
|
17
|
+
export { ParshaEvent } from './ParshaEvent';
|
|
18
|
+
export { HolidayEvent, AsaraBTevetEvent, RoshChodeshEvent, RoshHashanaEvent, } from './HolidayEvent';
|
|
19
|
+
export { HolidayYearMap, getHolidaysOnDate } from './holidays';
|
|
20
|
+
export { MevarchimChodeshEvent } from './MevarchimChodeshEvent';
|
|
21
|
+
export { holidayDesc } from './staticHolidays';
|
|
22
|
+
export { DailyLearning } from './DailyLearning';
|
|
23
|
+
export { HebrewCalendar } from './hebcal';
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*! @hebcal/core v5.7.0 */
|
|
2
|
+
export { version } from './pkgVersion.js';
|
|
3
|
+
export { HDate, Locale, gematriya, gematriyaStrToNum, greg, months } from '@hebcal/hdate';
|
|
4
|
+
import './locale.js';
|
|
5
|
+
export { HebrewDateEvent } from './HebrewDateEvent.js';
|
|
6
|
+
export { Event, flags } from './event.js';
|
|
7
|
+
export { GeoLocation, NOAACalculator } from '@hebcal/noaa';
|
|
8
|
+
export { Location } from './location.js';
|
|
9
|
+
export { Zmanim } from './zmanim.js';
|
|
10
|
+
export { CandleLightingEvent, HavdalahEvent, TimedEvent } from './TimedEvent.js';
|
|
11
|
+
export { FastDayEvent } from './candles.js';
|
|
12
|
+
export { Molad, MoladEvent } from './molad.js';
|
|
13
|
+
export { OmerEvent } from './omer.js';
|
|
14
|
+
export { Sedra, getSedra, parshiot } from './sedra.js';
|
|
15
|
+
export { ParshaEvent } from './ParshaEvent.js';
|
|
16
|
+
export { AsaraBTevetEvent, HolidayEvent, RoshChodeshEvent, RoshHashanaEvent } from './HolidayEvent.js';
|
|
17
|
+
export { getHolidaysOnDate } from './holidays.js';
|
|
18
|
+
export { MevarchimChodeshEvent } from './MevarchimChodeshEvent.js';
|
|
19
|
+
export { holidayDesc } from './staticHolidays.js';
|
|
20
|
+
export { DailyLearning } from './DailyLearning.js';
|
|
21
|
+
export { HebrewCalendar } from './hebcal.js';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*! @hebcal/core v5.7.0 */
|
|
2
|
+
import { Locale } from '@hebcal/hdate';
|
|
3
|
+
import poAshkenazi from './ashkenazi.po.js';
|
|
4
|
+
import poHe from './he.po.js';
|
|
5
|
+
|
|
6
|
+
Locale.addTranslations('he', poHe);
|
|
7
|
+
Locale.addTranslations('h', poHe);
|
|
8
|
+
Locale.addTranslations('ashkenazi', poAshkenazi);
|
|
9
|
+
Locale.addTranslations('a', poAshkenazi);
|
|
10
|
+
/* Hebrew without nikkud */
|
|
11
|
+
const heStrs = poHe.contexts[''];
|
|
12
|
+
const heNoNikud = {};
|
|
13
|
+
for (const [key, val] of Object.entries(heStrs)) {
|
|
14
|
+
heNoNikud[key] = [Locale.hebrewStripNikkud(val[0])];
|
|
15
|
+
}
|
|
16
|
+
const poHeNoNikud = {
|
|
17
|
+
headers: poHe.headers,
|
|
18
|
+
contexts: { '': heNoNikud },
|
|
19
|
+
};
|
|
20
|
+
Locale.addTranslations('he-x-NoNikud', poHeNoNikud);
|
|
21
|
+
//# sourceMappingURL=locale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale.js","sources":["../../../src/locale.ts"],"sourcesContent":["import {Locale, LocaleData, StringArrayMap} from '@hebcal/hdate';\nimport poAshkenazi from './ashkenazi.po';\nimport poHe from './he.po';\n\nLocale.addTranslations('he', poHe);\nLocale.addTranslations('h', poHe);\nLocale.addTranslations('ashkenazi', poAshkenazi);\nLocale.addTranslations('a', poAshkenazi);\n\n/* Hebrew without nikkud */\nconst heStrs = poHe.contexts[''];\nconst heNoNikud: StringArrayMap = {};\nfor (const [key, val] of Object.entries(heStrs)) {\n heNoNikud[key] = [Locale.hebrewStripNikkud(val[0])];\n}\nconst poHeNoNikud: LocaleData = {\n headers: poHe.headers,\n contexts: {'': heNoNikud},\n} as const;\nLocale.addTranslations('he-x-NoNikud', poHeNoNikud);\n"],"names":[],"mappings":";;;;;AAIA,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC;AAClC,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,IAAI,CAAC;AACjC,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,WAAW,CAAC;AAChD,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,WAAW,CAAC;AAExC;AACA,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;AAChC,MAAM,SAAS,GAAmB,EAAE;AACpC,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC/C,IAAA,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD;AACA,MAAM,WAAW,GAAe;IAC9B,OAAO,EAAE,IAAI,CAAC,OAAO;AACrB,IAAA,QAAQ,EAAE,EAAC,EAAE,EAAE,SAAS,EAAC;CACjB;AACV,MAAM,CAAC,eAAe,CAAC,cAAc,EAAE,WAAW,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { GeoLocation } from '@hebcal/noaa';
|
|
2
|
+
/** Class representing Location */
|
|
3
|
+
export declare class Location extends GeoLocation {
|
|
4
|
+
private readonly il;
|
|
5
|
+
private readonly cc?;
|
|
6
|
+
private readonly geoid?;
|
|
7
|
+
/**
|
|
8
|
+
* Initialize a Location instance
|
|
9
|
+
* @param latitude - Latitude as a decimal, valid range -90 thru +90 (e.g. 41.85003)
|
|
10
|
+
* @param longitude - Longitude as a decimal, valid range -180 thru +180 (e.g. -87.65005)
|
|
11
|
+
* @param il - in Israel (true) or Diaspora (false)
|
|
12
|
+
* @param tzid - Olson timezone ID, e.g. "America/Chicago"
|
|
13
|
+
* @param [cityName] - optional descriptive city name
|
|
14
|
+
* @param [countryCode] - ISO 3166 alpha-2 country code (e.g. "FR")
|
|
15
|
+
* @param [geoid] - optional string or numeric geographic ID
|
|
16
|
+
* @param [elevation] - in meters (default `0`)
|
|
17
|
+
*/
|
|
18
|
+
constructor(latitude: number, longitude: number, il: boolean, tzid: string, cityName?: string, countryCode?: string, geoid?: string | number, elevation?: number);
|
|
19
|
+
getIsrael(): boolean;
|
|
20
|
+
getName(): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the location name, up to the first comma
|
|
23
|
+
*/
|
|
24
|
+
getShortName(): string | null;
|
|
25
|
+
getCountryCode(): string | undefined;
|
|
26
|
+
getTzid(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Gets a 24-hour time formatter (e.g. 07:41 or 20:03) for this location
|
|
29
|
+
*/
|
|
30
|
+
getTimeFormatter(): Intl.DateTimeFormat;
|
|
31
|
+
getGeoId(): string | number | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a location object from one of 60 "classic" Hebcal city names.
|
|
34
|
+
* The following city names are supported:
|
|
35
|
+
* 'Ashdod', 'Atlanta', 'Austin', 'Baghdad', 'Beer Sheva',
|
|
36
|
+
* 'Berlin', 'Baltimore', 'Bogota', 'Boston', 'Budapest',
|
|
37
|
+
* 'Buenos Aires', 'Buffalo', 'Chicago', 'Cincinnati', 'Cleveland',
|
|
38
|
+
* 'Dallas', 'Denver', 'Detroit', 'Eilat', 'Gibraltar', 'Haifa',
|
|
39
|
+
* 'Hawaii', 'Helsinki', 'Houston', 'Jerusalem', 'Johannesburg',
|
|
40
|
+
* 'Kiev', 'La Paz', 'Livingston', 'Las Vegas', 'London', 'Los Angeles',
|
|
41
|
+
* 'Marseilles', 'Miami', 'Minneapolis', 'Melbourne', 'Mexico City',
|
|
42
|
+
* 'Montreal', 'Moscow', 'New York', 'Omaha', 'Ottawa', 'Panama City',
|
|
43
|
+
* 'Paris', 'Pawtucket', 'Petach Tikvah', 'Philadelphia', 'Phoenix',
|
|
44
|
+
* 'Pittsburgh', 'Providence', 'Portland', 'Saint Louis', 'Saint Petersburg',
|
|
45
|
+
* 'San Diego', 'San Francisco', 'Sao Paulo', 'Seattle', 'Sydney',
|
|
46
|
+
* 'Tel Aviv', 'Tiberias', 'Toronto', 'Vancouver', 'White Plains',
|
|
47
|
+
* 'Washington DC', 'Worcester'
|
|
48
|
+
* @param name
|
|
49
|
+
*/
|
|
50
|
+
static lookup(name: string): Location | undefined;
|
|
51
|
+
toString(): string;
|
|
52
|
+
/**
|
|
53
|
+
* Converts legacy Hebcal timezone to a standard Olson tzid.
|
|
54
|
+
* @param tz integer, GMT offset in hours
|
|
55
|
+
* @param dst 'none', 'eu', 'usa', or 'israel'
|
|
56
|
+
*/
|
|
57
|
+
static legacyTzToTzid(tz: number, dst: string): string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Converts timezone info from Zip-Codes.com to a standard Olson tzid.
|
|
60
|
+
* @example
|
|
61
|
+
* Location.getUsaTzid('AZ', 7, 'Y') // 'America/Denver'
|
|
62
|
+
* @param state two-letter all-caps US state abbreviation like 'CA'
|
|
63
|
+
* @param tz positive number, 5=America/New_York, 8=America/Los_Angeles
|
|
64
|
+
* @param dst single char 'Y' or 'N'
|
|
65
|
+
*/
|
|
66
|
+
static getUsaTzid(state: string, tz: number, dst: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* Adds a location name for `Location.lookup()` only if the name isn't
|
|
69
|
+
* already being used. Returns `false` if the name is already taken
|
|
70
|
+
* and `true` if successfully added.
|
|
71
|
+
*/
|
|
72
|
+
static addLocation(cityName: string, location: Location): boolean;
|
|
73
|
+
}
|