@hebcal/rest-api 3.19.5 → 4.2.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 +1 -69
- package/dist/bundle.js +80 -151
- package/dist/bundle.min.js +2 -2
- package/dist/fullcalendar.js +329 -0
- package/dist/fullcalendar.min.js +2 -0
- package/dist/index.js +15 -100
- package/dist/index.mjs +15 -76
- package/package.json +8 -7
- package/rest-api.d.ts +3 -16
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/*! @hebcal/rest-api v4.2.0 */
|
|
2
|
+
var hebcalFullCalendar = (function (exports, core, leyning) {
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
var Chanukah="Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights";var Pesach="Passover, the Feast of Unleavened Bread. Also called Chag HaMatzot (the Festival of Matzah), it commemorates the Exodus and freedom of the Israelites from ancient Egypt";var Purim="Celebration of Jewish deliverance as told by Megilat Esther. It commemorates a time when the Jewish people living in Persia were saved from extermination";var Shavuot="Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai";var Sigd="Ethiopian Jewish holiday occurring 50 days after Yom Kippur";var Sukkot="Feast of Booths";var holidayDescription = {"Asara B'Tevet":"Fast commemorating the siege of Jerusalem",Chanukah:Chanukah,"Days of the Omer":"7 weeks from the second night of Pesach to the day before Shavuot","Lag BaOmer":"33rd day of counting the Omer","Leil Selichot":"Prayers for forgiveness in preparation for the High Holidays","Pesach Sheni":"Second Passover, one month after Passover",Pesach:Pesach,"Purim Katan":"Minor Purim celebration during Adar I on leap years",Purim:Purim,"Rosh Chodesh Nisan":"Start of month of Nisan on the Hebrew calendar. נִיסָן (transliterated Nisan or Nissan) is the 1st month of the Hebrew year, has 30 days, and corresponds to March or April on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Iyyar":"Start of month of Iyyar on the Hebrew calendar. אִיָיר (transliterated Iyyar or Iyar) is the 2nd month of the Hebrew year, has 29 days, and corresponds to April or May on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sivan":"Start of month of Sivan on the Hebrew calendar. Sivan (סִיוָן) is the 3rd month of the Hebrew year, has 30 days, and corresponds to May or June on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tamuz":"Start of month of Tamuz on the Hebrew calendar. תַּמּוּז (transliterated Tamuz or Tammuz) is the 4th month of the Hebrew year, has 29 days, and corresponds to June or July on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Av":"Start of month of Av on the Hebrew calendar. Av (אָב) is the 5th month of the Hebrew year, has 30 days, and corresponds to July or August on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Elul":"Start of month of Elul on the Hebrew calendar. Elul (אֱלוּל) is the 6th month of the Hebrew year, has 29 days, and corresponds to August or September on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Cheshvan":"Start of month of Cheshvan on the Hebrew calendar. חֶשְׁוָן (transliterated Cheshvan or Heshvan) is the 8th month of the Hebrew year, has 29 or 30 days, and corresponds to October or November on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Kislev":"Start of month of Kislev on the Hebrew calendar. Kislev (כִּסְלֵו) is the 9th month of the Hebrew year, has 30 or 29 days, and corresponds to November or December on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tevet":"Start of month of Tevet on the Hebrew calendar. Tevet (טֵבֵת) is the 10th month of the Hebrew year, has 29 days, and corresponds to December or January on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sh'vat":"Start of month of Sh'vat on the Hebrew calendar. שְׁבָט (transliterated Sh'vat or Shevat) is the 11th month of the Hebrew year, has 30 days, and corresponds to January or February on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar":"Start of month of Adar on the Hebrew calendar. Adar (אַדָר) is the 12th month of the Hebrew year, has 29 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar I":"Start of month of Adar I (on leap years) on the Hebrew calendar. Adar I (אַדָר א׳) is the 12th month of the Hebrew year, occurs only on leap years, has 30 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar II":"Start of month of Adar II (on leap years) on the Hebrew calendar. Adar II (אַדָר ב׳), sometimes \"Adar Bet\" or \"Adar Sheni\", is the 13th month of the Hebrew year, has 29 days, occurs only on leap years, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Hashana":"The Jewish New Year. Also spelled Rosh Hashanah","Rosh Hashana LaBehemot":"New Year for Tithing Animals","Shabbat Chazon":"Shabbat before Tish'a B'Av (Shabbat of Prophecy/Shabbat of Vision)","Shabbat HaChodesh":"Shabbat before Rosh Chodesh Nissan","Shabbat HaGadol":"Shabbat before Pesach","Shabbat Machar Chodesh":"When Shabbat falls the day before Rosh Chodesh","Shabbat Nachamu":"Shabbat after Tish'a B'Av (Shabbat of Consolation). The first of seven Shabbatot leading up to Rosh Hashanah. Named after the Haftarah (from Isaiah 40) which begins with the verse נַחֲמוּ נַחֲמוּ, עַמִּי (\"Comfort, oh comfort my people\")","Shabbat Parah":"Shabbat of the Red Heifer","Shabbat Rosh Chodesh":"When Shabbat falls on Rosh Chodesh","Shabbat Shekalim":"Shabbat before Rosh Chodesh Adar","Shabbat Shirah":"Shabbat of Song","Shabbat Shuva":"Shabbat that falls between Rosh Hashanah and Yom Kippur (Shabbat of Returning)","Shabbat Zachor":"Shabbat before Purim",Shavuot:Shavuot,"Shmini Atzeret":"Eighth Day of Assembly","Shushan Purim":"Purim celebrated in Jerusalem and walled cities",Sigd:Sigd,"Simchat Torah":"Day of Celebrating the Torah",Sukkot:Sukkot,"Ta'anit Bechorot":"Fast of the First Born","Ta'anit Esther":"Fast of Esther","Tish'a B'Av":"The Ninth of Av. Fast commemorating the destruction of the two Temples","Tu B'Av":"Minor Jewish holiday of love. Observed on the 15th day of the Hebrew month of Av","Tu BiShvat":"New Year for Trees","Tzom Gedaliah":"Fast of the Seventh Month. Commemorates the assassination of the Jewish governor of Judah","Tzom Tammuz":"Fast commemorating breaching of the walls of Jerusalem before the destruction of the Second Temple","Yom HaAliyah":"Recognizes Aliyah, immigration to the Jewish State of Israel","Yom HaAliyah School Observance":"Aliyah Day observed in Israeli schools","Yom HaAtzma'ut":"Israeli Independence Day. Commemorates the declaration of independence of Israel in 1948. Although Yom HaAtzma'ut is normally observed on the 5th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaZikaron, which always precedes it) would conflict with Shabbat","Yom HaShoah":"Holocaust Memorial Day","Yom HaZikaron":"Israeli Memorial Day. Remembers those who died in the War of Independence and other wars in Israel. The full name of the holiday is Yom HaZikaron LeHalalei Ma'arakhot Yisrael ul'Nifge'ei Pe'ulot HaEivah (Hebrew: יוֹם הזִּכָּרוֹן לְחַלְלֵי מַעֲרָכוֹת יִשְׂרָאֵל וּלְנִפְגְעֵי פְּעֻלּוֹת הָאֵיבָה), Memorial Day for the Fallen Soldiers of the Wars of Israel and Victims of Actions of Terrorism. Although Yom Hazikaron is normally observed on the 4th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaAtzma'ut, which always follows it) would conflict with Shabbat","Yom Kippur":"Day of Atonement","Yom Kippur Katan":"Minor day of atonement occurring monthly on the day preceeding each Rosh Chodesh","Yom Yerushalayim":"Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"};
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @param {number} number
|
|
9
|
+
* @return {string}
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
function pad2(number) {
|
|
13
|
+
if (number < 10) {
|
|
14
|
+
return '0' + number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return '' + number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @param {number} number
|
|
21
|
+
* @return {string}
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
function pad4(number) {
|
|
25
|
+
if (number < 0) {
|
|
26
|
+
return '-00' + pad4(-number);
|
|
27
|
+
} else if (number < 10) {
|
|
28
|
+
return '000' + number;
|
|
29
|
+
} else if (number < 100) {
|
|
30
|
+
return '00' + number;
|
|
31
|
+
} else if (number < 1000) {
|
|
32
|
+
return '0' + number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return '' + number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Returns just the date portion as YYYY-MM-DD
|
|
39
|
+
* @param {Date} d
|
|
40
|
+
* @return {string}
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
function toISOString(d) {
|
|
44
|
+
return pad4(d.getFullYear()) + '-' + pad2(d.getMonth() + 1) + '-' + pad2(d.getDate());
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Returns a category and subcategory name
|
|
48
|
+
* @param {Event} ev
|
|
49
|
+
* @return {string[]}
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
function getEventCategories(ev) {
|
|
53
|
+
var desc = ev.getDesc(); // since these use flags.MINOR_FAST or flags.MAJOR_FAST, check description first
|
|
54
|
+
|
|
55
|
+
if (desc === 'Fast begins' || desc === 'Fast ends') {
|
|
56
|
+
return ['zmanim', 'fast'];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
switch (ev.getFlags()) {
|
|
60
|
+
case core.flags.OMER_COUNT:
|
|
61
|
+
return ['omer'];
|
|
62
|
+
|
|
63
|
+
case core.flags.HEBREW_DATE:
|
|
64
|
+
return ['hebdate'];
|
|
65
|
+
|
|
66
|
+
case core.flags.PARSHA_HASHAVUA:
|
|
67
|
+
return ['parashat'];
|
|
68
|
+
// backwards-compat
|
|
69
|
+
|
|
70
|
+
case core.flags.DAF_YOMI:
|
|
71
|
+
return ['dafyomi'];
|
|
72
|
+
|
|
73
|
+
case core.flags.ROSH_CHODESH:
|
|
74
|
+
return ['roshchodesh'];
|
|
75
|
+
|
|
76
|
+
case core.flags.SPECIAL_SHABBAT:
|
|
77
|
+
return ['holiday', 'shabbat'];
|
|
78
|
+
|
|
79
|
+
case core.flags.MINOR_FAST:
|
|
80
|
+
return ['holiday', 'fast'];
|
|
81
|
+
|
|
82
|
+
case core.flags.MAJOR_FAST:
|
|
83
|
+
return ['holiday', 'fast', 'major'];
|
|
84
|
+
|
|
85
|
+
case core.flags.MODERN_HOLIDAY:
|
|
86
|
+
return ['holiday', 'modern'];
|
|
87
|
+
|
|
88
|
+
case core.flags.SHABBAT_MEVARCHIM:
|
|
89
|
+
return ['mevarchim'];
|
|
90
|
+
|
|
91
|
+
case core.flags.MOLAD:
|
|
92
|
+
return ['molad'];
|
|
93
|
+
|
|
94
|
+
case core.flags.USER_EVENT:
|
|
95
|
+
return ['user'];
|
|
96
|
+
|
|
97
|
+
case core.flags.MINOR_HOLIDAY:
|
|
98
|
+
return ['holiday', 'minor'];
|
|
99
|
+
|
|
100
|
+
case core.flags.MISHNA_YOMI:
|
|
101
|
+
return ['mishnayomi'];
|
|
102
|
+
// fall through to string-based category
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (ev.cholHaMoedDay) {
|
|
106
|
+
return ['holiday', 'major', 'cholhamoed'];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
switch (desc) {
|
|
110
|
+
case 'Havdalah':
|
|
111
|
+
return ['havdalah'];
|
|
112
|
+
|
|
113
|
+
case 'Candle lighting':
|
|
114
|
+
return ['candles'];
|
|
115
|
+
|
|
116
|
+
case 'Lag BaOmer':
|
|
117
|
+
case 'Leil Selichot':
|
|
118
|
+
case 'Pesach Sheni':
|
|
119
|
+
case 'Erev Purim':
|
|
120
|
+
case 'Purim Katan':
|
|
121
|
+
case 'Shushan Purim':
|
|
122
|
+
case 'Tu B\'Av':
|
|
123
|
+
case 'Tu BiShvat':
|
|
124
|
+
case 'Rosh Hashana LaBehemot':
|
|
125
|
+
return ['holiday', 'minor'];
|
|
126
|
+
|
|
127
|
+
case 'Erev Tish\'a B\'Av':
|
|
128
|
+
return ['holiday', 'fast', 'major'];
|
|
129
|
+
|
|
130
|
+
default:
|
|
131
|
+
return ['holiday', 'major'];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
var HOLIDAY_IGNORE_MASK = core.flags.DAF_YOMI | core.flags.OMER_COUNT | core.flags.SHABBAT_MEVARCHIM | core.flags.MOLAD | core.flags.USER_EVENT | core.flags.HEBREW_DATE;
|
|
135
|
+
/**
|
|
136
|
+
* Makes mulit-line text that summarizes Torah & Haftarah
|
|
137
|
+
* @param {Event} ev
|
|
138
|
+
* @param {boolean} il
|
|
139
|
+
* @return {string}
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
function makeTorahMemoText(ev, il) {
|
|
143
|
+
var mask = ev.getFlags();
|
|
144
|
+
|
|
145
|
+
if (mask & HOLIDAY_IGNORE_MASK) {
|
|
146
|
+
return '';
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
var reading = mask & core.flags.PARSHA_HASHAVUA ? leyning.getLeyningForParshaHaShavua(ev, il) : leyning.getLeyningForHoliday(ev, il);
|
|
150
|
+
var memo = '';
|
|
151
|
+
|
|
152
|
+
if (reading && (reading.summary || reading.haftara)) {
|
|
153
|
+
if (reading.summary) {
|
|
154
|
+
memo += "Torah: ".concat(reading.summary);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (reading.summary && reading.haftara) {
|
|
158
|
+
memo += '\n';
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (reading.haftara) {
|
|
162
|
+
memo += 'Haftarah: ' + reading.haftara;
|
|
163
|
+
|
|
164
|
+
if (reading.reason && reading.reason.haftara) {
|
|
165
|
+
memo += ' | ' + reading.reason.haftara;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (reading && reading.sephardic) {
|
|
171
|
+
memo += '\nHaftarah for Sephardim: ' + reading.sephardic;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return memo;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Appends utm_source and utm_medium parameters to a URL
|
|
178
|
+
* @param {string} url
|
|
179
|
+
* @param {boolean} il
|
|
180
|
+
* @param {string} utmSource
|
|
181
|
+
* @param {string} utmMedium
|
|
182
|
+
* @param {string} utmCampaign
|
|
183
|
+
* @return {string}
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
function appendIsraelAndTracking(url, il, utmSource, utmMedium, utmCampaign) {
|
|
187
|
+
var u = new URL(url);
|
|
188
|
+
var isHebcal = u.host === 'www.hebcal.com';
|
|
189
|
+
|
|
190
|
+
if (isHebcal) {
|
|
191
|
+
if (il) {
|
|
192
|
+
u.searchParams.set('i', 'on');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
var path = u.pathname;
|
|
196
|
+
var isHolidays = path.startsWith('/holidays/');
|
|
197
|
+
var isSedrot = path.startsWith('/sedrot/');
|
|
198
|
+
var isOmer = path.startsWith('/omer/');
|
|
199
|
+
|
|
200
|
+
if (isHolidays || isSedrot || isOmer) {
|
|
201
|
+
u.host = 'hebcal.com';
|
|
202
|
+
|
|
203
|
+
if (isHolidays) {
|
|
204
|
+
u.pathname = '/h/' + path.substring(10);
|
|
205
|
+
} else if (isSedrot) {
|
|
206
|
+
u.pathname = '/s/' + path.substring(8);
|
|
207
|
+
} else {
|
|
208
|
+
// isOmer
|
|
209
|
+
u.pathname = '/o/' + path.substring(6);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (!utmCampaign || !(utmCampaign.startsWith('ical-') || utmCampaign.startsWith('pdf-'))) {
|
|
213
|
+
if (utmSource) {
|
|
214
|
+
u.searchParams.set('us', utmSource);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (utmMedium) {
|
|
218
|
+
u.searchParams.set('um', utmMedium);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (utmCampaign) {
|
|
223
|
+
u.searchParams.set('uc', utmCampaign);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return u.toString();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
utmSource = isHebcal ? utmSource : 'hebcal.com';
|
|
231
|
+
|
|
232
|
+
if (utmSource) {
|
|
233
|
+
u.searchParams.set('utm_source', utmSource);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (utmMedium) {
|
|
237
|
+
u.searchParams.set('utm_medium', utmMedium);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (utmCampaign) {
|
|
241
|
+
u.searchParams.set('utm_campaign', utmCampaign);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return u.toString();
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* @private
|
|
248
|
+
* @param {Event} ev
|
|
249
|
+
* @return {boolean}
|
|
250
|
+
*/
|
|
251
|
+
|
|
252
|
+
function shouldRenderBrief(ev) {
|
|
253
|
+
if (typeof ev.eventTime !== 'undefined') return true;
|
|
254
|
+
var mask = ev.getFlags();
|
|
255
|
+
|
|
256
|
+
if (mask & core.flags.HEBREW_DATE) {
|
|
257
|
+
var hd = ev.getDate();
|
|
258
|
+
return hd.getDate() === 1 ? false : true;
|
|
259
|
+
} else if (mask & core.flags.DAF_YOMI) {
|
|
260
|
+
return true;
|
|
261
|
+
} else if (mask & core.flags.MINOR_FAST && ev.getDesc().substring(0, 16) === 'Yom Kippur Katan') {
|
|
262
|
+
return true;
|
|
263
|
+
} else if (mask & core.flags.SHABBAT_MEVARCHIM) {
|
|
264
|
+
return true;
|
|
265
|
+
} else {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Converts a Hebcal event to a FullCalendar.io object
|
|
272
|
+
* @param {Event} ev
|
|
273
|
+
* @param {string} tzid timeZone identifier
|
|
274
|
+
* @param {boolean} il true if Israel
|
|
275
|
+
* @return {Object}
|
|
276
|
+
*/
|
|
277
|
+
|
|
278
|
+
function eventToFullCalendar(ev, tzid, il) {
|
|
279
|
+
var classes = getEventCategories(ev);
|
|
280
|
+
var mask = ev.getFlags();
|
|
281
|
+
|
|
282
|
+
if (classes[0] == 'holiday' && mask & core.flags.CHAG) {
|
|
283
|
+
classes.push('yomtov');
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
var timed = Boolean(ev.eventTime);
|
|
287
|
+
var title = shouldRenderBrief(ev) ? ev.renderBrief() : ev.render();
|
|
288
|
+
var start = timed ? core.Zmanim.formatISOWithTimeZone(tzid, ev.eventTime) : toISOString(ev.getDate().greg());
|
|
289
|
+
var result = {
|
|
290
|
+
title: title,
|
|
291
|
+
start: start,
|
|
292
|
+
allDay: !timed,
|
|
293
|
+
className: classes.join(' ')
|
|
294
|
+
};
|
|
295
|
+
var hebrew = ev.renderBrief('he');
|
|
296
|
+
|
|
297
|
+
if (hebrew) {
|
|
298
|
+
result.hebrew = core.Locale.hebrewStripNikkud(hebrew);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
var url = ev.url();
|
|
302
|
+
|
|
303
|
+
if (url) {
|
|
304
|
+
result.url = appendIsraelAndTracking(url, il, 'js', 'fc');
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
var desc = ev.getDesc();
|
|
308
|
+
var candles = desc === 'Havdalah' || desc === 'Candle lighting';
|
|
309
|
+
|
|
310
|
+
if (!candles) {
|
|
311
|
+
var memo = mask & core.flags.PARSHA_HASHAVUA ? makeTorahMemoText(ev, il) : ev.memo || holidayDescription[ev.basename()];
|
|
312
|
+
|
|
313
|
+
if (memo) {
|
|
314
|
+
result.description = memo;
|
|
315
|
+
} else if (typeof ev.linkedEvent !== 'undefined') {
|
|
316
|
+
result.description = ev.linkedEvent.render();
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return result;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
exports.eventToFullCalendar = eventToFullCalendar;
|
|
324
|
+
|
|
325
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
326
|
+
|
|
327
|
+
return exports;
|
|
328
|
+
|
|
329
|
+
})({}, hebcal, hebcal__leyning);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @hebcal/rest-api v4.2.0 */
|
|
2
|
+
var hebcalFullCalendar=function(e,a,o){"use strict";var r={"Asara B'Tevet":"Fast commemorating the siege of Jerusalem",Chanukah:"Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights","Days of the Omer":"7 weeks from the second night of Pesach to the day before Shavuot","Lag BaOmer":"33rd day of counting the Omer","Leil Selichot":"Prayers for forgiveness in preparation for the High Holidays","Pesach Sheni":"Second Passover, one month after Passover",Pesach:"Passover, the Feast of Unleavened Bread. Also called Chag HaMatzot (the Festival of Matzah), it commemorates the Exodus and freedom of the Israelites from ancient Egypt","Purim Katan":"Minor Purim celebration during Adar I on leap years",Purim:"Celebration of Jewish deliverance as told by Megilat Esther. It commemorates a time when the Jewish people living in Persia were saved from extermination","Rosh Chodesh Nisan":"Start of month of Nisan on the Hebrew calendar. נִיסָן (transliterated Nisan or Nissan) is the 1st month of the Hebrew year, has 30 days, and corresponds to March or April on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Iyyar":"Start of month of Iyyar on the Hebrew calendar. אִיָיר (transliterated Iyyar or Iyar) is the 2nd month of the Hebrew year, has 29 days, and corresponds to April or May on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sivan":"Start of month of Sivan on the Hebrew calendar. Sivan (סִיוָן) is the 3rd month of the Hebrew year, has 30 days, and corresponds to May or June on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tamuz":"Start of month of Tamuz on the Hebrew calendar. תַּמּוּז (transliterated Tamuz or Tammuz) is the 4th month of the Hebrew year, has 29 days, and corresponds to June or July on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Av":"Start of month of Av on the Hebrew calendar. Av (אָב) is the 5th month of the Hebrew year, has 30 days, and corresponds to July or August on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Elul":"Start of month of Elul on the Hebrew calendar. Elul (אֱלוּל) is the 6th month of the Hebrew year, has 29 days, and corresponds to August or September on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Cheshvan":"Start of month of Cheshvan on the Hebrew calendar. חֶשְׁוָן (transliterated Cheshvan or Heshvan) is the 8th month of the Hebrew year, has 29 or 30 days, and corresponds to October or November on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Kislev":"Start of month of Kislev on the Hebrew calendar. Kislev (כִּסְלֵו) is the 9th month of the Hebrew year, has 30 or 29 days, and corresponds to November or December on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tevet":"Start of month of Tevet on the Hebrew calendar. Tevet (טֵבֵת) is the 10th month of the Hebrew year, has 29 days, and corresponds to December or January on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sh'vat":"Start of month of Sh'vat on the Hebrew calendar. שְׁבָט (transliterated Sh'vat or Shevat) is the 11th month of the Hebrew year, has 30 days, and corresponds to January or February on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar":"Start of month of Adar on the Hebrew calendar. Adar (אַדָר) is the 12th month of the Hebrew year, has 29 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar I":"Start of month of Adar I (on leap years) on the Hebrew calendar. Adar I (אַדָר א׳) is the 12th month of the Hebrew year, occurs only on leap years, has 30 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar II":'Start of month of Adar II (on leap years) on the Hebrew calendar. Adar II (אַדָר ב׳), sometimes "Adar Bet" or "Adar Sheni", is the 13th month of the Hebrew year, has 29 days, occurs only on leap years, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon',"Rosh Hashana":"The Jewish New Year. Also spelled Rosh Hashanah","Rosh Hashana LaBehemot":"New Year for Tithing Animals","Shabbat Chazon":"Shabbat before Tish'a B'Av (Shabbat of Prophecy/Shabbat of Vision)","Shabbat HaChodesh":"Shabbat before Rosh Chodesh Nissan","Shabbat HaGadol":"Shabbat before Pesach","Shabbat Machar Chodesh":"When Shabbat falls the day before Rosh Chodesh","Shabbat Nachamu":"Shabbat after Tish'a B'Av (Shabbat of Consolation). The first of seven Shabbatot leading up to Rosh Hashanah. Named after the Haftarah (from Isaiah 40) which begins with the verse נַחֲמוּ נַחֲמוּ, עַמִּי (\"Comfort, oh comfort my people\")","Shabbat Parah":"Shabbat of the Red Heifer","Shabbat Rosh Chodesh":"When Shabbat falls on Rosh Chodesh","Shabbat Shekalim":"Shabbat before Rosh Chodesh Adar","Shabbat Shirah":"Shabbat of Song","Shabbat Shuva":"Shabbat that falls between Rosh Hashanah and Yom Kippur (Shabbat of Returning)","Shabbat Zachor":"Shabbat before Purim",Shavuot:"Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai","Shmini Atzeret":"Eighth Day of Assembly","Shushan Purim":"Purim celebrated in Jerusalem and walled cities",Sigd:"Ethiopian Jewish holiday occurring 50 days after Yom Kippur","Simchat Torah":"Day of Celebrating the Torah",Sukkot:"Feast of Booths","Ta'anit Bechorot":"Fast of the First Born","Ta'anit Esther":"Fast of Esther","Tish'a B'Av":"The Ninth of Av. Fast commemorating the destruction of the two Temples","Tu B'Av":"Minor Jewish holiday of love. Observed on the 15th day of the Hebrew month of Av","Tu BiShvat":"New Year for Trees","Tzom Gedaliah":"Fast of the Seventh Month. Commemorates the assassination of the Jewish governor of Judah","Tzom Tammuz":"Fast commemorating breaching of the walls of Jerusalem before the destruction of the Second Temple","Yom HaAliyah":"Recognizes Aliyah, immigration to the Jewish State of Israel","Yom HaAliyah School Observance":"Aliyah Day observed in Israeli schools","Yom HaAtzma'ut":"Israeli Independence Day. Commemorates the declaration of independence of Israel in 1948. Although Yom HaAtzma'ut is normally observed on the 5th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaZikaron, which always precedes it) would conflict with Shabbat","Yom HaShoah":"Holocaust Memorial Day","Yom HaZikaron":"Israeli Memorial Day. Remembers those who died in the War of Independence and other wars in Israel. The full name of the holiday is Yom HaZikaron LeHalalei Ma'arakhot Yisrael ul'Nifge'ei Pe'ulot HaEivah (Hebrew: יוֹם הזִּכָּרוֹן לְחַלְלֵי מַעֲרָכוֹת יִשְׂרָאֵל וּלְנִפְגְעֵי פְּעֻלּוֹת הָאֵיבָה), Memorial Day for the Fallen Soldiers of the Wars of Israel and Victims of Actions of Terrorism. Although Yom Hazikaron is normally observed on the 4th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaAtzma'ut, which always follows it) would conflict with Shabbat","Yom Kippur":"Day of Atonement","Yom Kippur Katan":"Minor day of atonement occurring monthly on the day preceeding each Rosh Chodesh","Yom Yerushalayim":"Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"};function t(e){return e<10?"0"+e:""+e}function h(e){return e<0?"-00"+h(-e):e<10?"000"+e:e<100?"00"+e:e<1e3?"0"+e:""+e}function s(e){return h(e.getFullYear())+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())}var n=a.flags.DAF_YOMI|a.flags.OMER_COUNT|a.flags.SHABBAT_MEVARCHIM|a.flags.MOLAD|a.flags.USER_EVENT|a.flags.HEBREW_DATE;return e.eventToFullCalendar=function(e,t,h){var i=function(e){var o=e.getDesc();if("Fast begins"===o||"Fast ends"===o)return["zmanim","fast"];switch(e.getFlags()){case a.flags.OMER_COUNT:return["omer"];case a.flags.HEBREW_DATE:return["hebdate"];case a.flags.PARSHA_HASHAVUA:return["parashat"];case a.flags.DAF_YOMI:return["dafyomi"];case a.flags.ROSH_CHODESH:return["roshchodesh"];case a.flags.SPECIAL_SHABBAT:return["holiday","shabbat"];case a.flags.MINOR_FAST:return["holiday","fast"];case a.flags.MAJOR_FAST:return["holiday","fast","major"];case a.flags.MODERN_HOLIDAY:return["holiday","modern"];case a.flags.SHABBAT_MEVARCHIM:return["mevarchim"];case a.flags.MOLAD:return["molad"];case a.flags.USER_EVENT:return["user"];case a.flags.MINOR_HOLIDAY:return["holiday","minor"];case a.flags.MISHNA_YOMI:return["mishnayomi"]}if(e.cholHaMoedDay)return["holiday","major","cholhamoed"];switch(o){case"Havdalah":return["havdalah"];case"Candle lighting":return["candles"];case"Lag BaOmer":case"Leil Selichot":case"Pesach Sheni":case"Erev Purim":case"Purim Katan":case"Shushan Purim":case"Tu B'Av":case"Tu BiShvat":case"Rosh Hashana LaBehemot":return["holiday","minor"];case"Erev Tish'a B'Av":return["holiday","fast","major"];default:return["holiday","major"]}}(e),d=e.getFlags();"holiday"==i[0]&&d&a.flags.CHAG&&i.push("yomtov");var l=Boolean(e.eventTime),m=function(e){if(void 0!==e.eventTime)return!0;var o=e.getFlags();return o&a.flags.HEBREW_DATE?1!==e.getDate().getDate():!!(o&a.flags.DAF_YOMI)||!!(o&a.flags.MINOR_FAST&&"Yom Kippur Katan"===e.getDesc().substring(0,16))||!!(o&a.flags.SHABBAT_MEVARCHIM)}(e)?e.renderBrief():e.render(),c={title:m,start:l?a.Zmanim.formatISOWithTimeZone(t,e.eventTime):s(e.getDate().greg()),allDay:!l,className:i.join(" ")},f=e.renderBrief("he");f&&(c.hebrew=a.Locale.hebrewStripNikkud(f));var b=e.url();b&&(c.url=function(e,a,o,r,t){var h=new URL(e),s="www.hebcal.com"===h.host;if(s){a&&h.searchParams.set("i","on");var n=h.pathname,i=n.startsWith("/holidays/"),d=n.startsWith("/sedrot/"),l=n.startsWith("/omer/");if(i||d||l)return h.host="hebcal.com",h.pathname=i?"/h/"+n.substring(10):d?"/s/"+n.substring(8):"/o/"+n.substring(6),t&&(t.startsWith("ical-")||t.startsWith("pdf-"))||(o&&h.searchParams.set("us",o),r&&h.searchParams.set("um",r)),t&&h.searchParams.set("uc",t),h.toString()}return(o=s?o:"hebcal.com")&&h.searchParams.set("utm_source",o),r&&h.searchParams.set("utm_medium",r),t&&h.searchParams.set("utm_campaign",t),h.toString()}(b,h,"js","fc"));var u=e.getDesc();if(!("Havdalah"===u||"Candle lighting"===u)){var y=d&a.flags.PARSHA_HASHAVUA?function(e,r){var t=e.getFlags();if(t&n)return"";var h=t&a.flags.PARSHA_HASHAVUA?o.getLeyningForParshaHaShavua(e,r):o.getLeyningForHoliday(e,r),s="";return h&&(h.summary||h.haftara)&&(h.summary&&(s+="Torah: ".concat(h.summary)),h.summary&&h.haftara&&(s+="\n"),h.haftara&&(s+="Haftarah: "+h.haftara,h.reason&&h.reason.haftara&&(s+=" | "+h.reason.haftara))),h&&h.sephardic&&(s+="\nHaftarah for Sephardim: "+h.sephardic),s}(e,h):e.memo||r[e.basename()];y?c.description=y:void 0!==e.linkedEvent&&(c.description=e.linkedEvent.render())}return c},Object.defineProperty(e,"__esModule",{value:!0}),e}({},hebcal,hebcal__leyning);
|
package/dist/index.js
CHANGED
|
@@ -1,30 +1,11 @@
|
|
|
1
|
-
/*! @hebcal/rest-api
|
|
1
|
+
/*! @hebcal/rest-api v4.2.0 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var core = require('@hebcal/core');
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
function _interopNamespace(e) {
|
|
10
|
-
if (e && e.__esModule) return e;
|
|
11
|
-
var n = Object.create(null);
|
|
12
|
-
if (e) {
|
|
13
|
-
Object.keys(e).forEach(function (k) {
|
|
14
|
-
if (k !== 'default') {
|
|
15
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return e[k]; }
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
n["default"] = e;
|
|
24
|
-
return Object.freeze(n);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var leyn__namespace = /*#__PURE__*/_interopNamespace(leyn);
|
|
7
|
+
var leyning = require('@hebcal/leyning');
|
|
8
|
+
var triennial = require('@hebcal/triennial');
|
|
28
9
|
|
|
29
10
|
var Chanukah="Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights";var Pesach="Passover, the Feast of Unleavened Bread. Also called Chag HaMatzot (the Festival of Matzah), it commemorates the Exodus and freedom of the Israelites from ancient Egypt";var Purim="Celebration of Jewish deliverance as told by Megilat Esther. It commemorates a time when the Jewish people living in Persia were saved from extermination";var Shavuot="Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai";var Sigd="Ethiopian Jewish holiday occurring 50 days after Yom Kippur";var Sukkot="Feast of Booths";var holidayDescription = {"Asara B'Tevet":"Fast commemorating the siege of Jerusalem",Chanukah:Chanukah,"Days of the Omer":"7 weeks from the second night of Pesach to the day before Shavuot","Lag BaOmer":"33rd day of counting the Omer","Leil Selichot":"Prayers for forgiveness in preparation for the High Holidays","Pesach Sheni":"Second Passover, one month after Passover",Pesach:Pesach,"Purim Katan":"Minor Purim celebration during Adar I on leap years",Purim:Purim,"Rosh Chodesh Nisan":"Start of month of Nisan on the Hebrew calendar. נִיסָן (transliterated Nisan or Nissan) is the 1st month of the Hebrew year, has 30 days, and corresponds to March or April on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Iyyar":"Start of month of Iyyar on the Hebrew calendar. אִיָיר (transliterated Iyyar or Iyar) is the 2nd month of the Hebrew year, has 29 days, and corresponds to April or May on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sivan":"Start of month of Sivan on the Hebrew calendar. Sivan (סִיוָן) is the 3rd month of the Hebrew year, has 30 days, and corresponds to May or June on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tamuz":"Start of month of Tamuz on the Hebrew calendar. תַּמּוּז (transliterated Tamuz or Tammuz) is the 4th month of the Hebrew year, has 29 days, and corresponds to June or July on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Av":"Start of month of Av on the Hebrew calendar. Av (אָב) is the 5th month of the Hebrew year, has 30 days, and corresponds to July or August on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Elul":"Start of month of Elul on the Hebrew calendar. Elul (אֱלוּל) is the 6th month of the Hebrew year, has 29 days, and corresponds to August or September on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Cheshvan":"Start of month of Cheshvan on the Hebrew calendar. חֶשְׁוָן (transliterated Cheshvan or Heshvan) is the 8th month of the Hebrew year, has 29 or 30 days, and corresponds to October or November on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Kislev":"Start of month of Kislev on the Hebrew calendar. Kislev (כִּסְלֵו) is the 9th month of the Hebrew year, has 30 or 29 days, and corresponds to November or December on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tevet":"Start of month of Tevet on the Hebrew calendar. Tevet (טֵבֵת) is the 10th month of the Hebrew year, has 29 days, and corresponds to December or January on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sh'vat":"Start of month of Sh'vat on the Hebrew calendar. שְׁבָט (transliterated Sh'vat or Shevat) is the 11th month of the Hebrew year, has 30 days, and corresponds to January or February on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar":"Start of month of Adar on the Hebrew calendar. Adar (אַדָר) is the 12th month of the Hebrew year, has 29 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar I":"Start of month of Adar I (on leap years) on the Hebrew calendar. Adar I (אַדָר א׳) is the 12th month of the Hebrew year, occurs only on leap years, has 30 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar II":"Start of month of Adar II (on leap years) on the Hebrew calendar. Adar II (אַדָר ב׳), sometimes \"Adar Bet\" or \"Adar Sheni\", is the 13th month of the Hebrew year, has 29 days, occurs only on leap years, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Hashana":"The Jewish New Year. Also spelled Rosh Hashanah","Rosh Hashana LaBehemot":"New Year for Tithing Animals","Shabbat Chazon":"Shabbat before Tish'a B'Av (Shabbat of Prophecy/Shabbat of Vision)","Shabbat HaChodesh":"Shabbat before Rosh Chodesh Nissan","Shabbat HaGadol":"Shabbat before Pesach","Shabbat Machar Chodesh":"When Shabbat falls the day before Rosh Chodesh","Shabbat Nachamu":"Shabbat after Tish'a B'Av (Shabbat of Consolation). The first of seven Shabbatot leading up to Rosh Hashanah. Named after the Haftarah (from Isaiah 40) which begins with the verse נַחֲמוּ נַחֲמוּ, עַמִּי (\"Comfort, oh comfort my people\")","Shabbat Parah":"Shabbat of the Red Heifer","Shabbat Rosh Chodesh":"When Shabbat falls on Rosh Chodesh","Shabbat Shekalim":"Shabbat before Rosh Chodesh Adar","Shabbat Shirah":"Shabbat of Song","Shabbat Shuva":"Shabbat that falls between Rosh Hashanah and Yom Kippur (Shabbat of Returning)","Shabbat Zachor":"Shabbat before Purim",Shavuot:Shavuot,"Shmini Atzeret":"Eighth Day of Assembly","Shushan Purim":"Purim celebrated in Jerusalem and walled cities",Sigd:Sigd,"Simchat Torah":"Day of Celebrating the Torah",Sukkot:Sukkot,"Ta'anit Bechorot":"Fast of the First Born","Ta'anit Esther":"Fast of Esther","Tish'a B'Av":"The Ninth of Av. Fast commemorating the destruction of the two Temples","Tu B'Av":"Minor Jewish holiday of love. Observed on the 15th day of the Hebrew month of Av","Tu BiShvat":"New Year for Trees","Tzom Gedaliah":"Fast of the Seventh Month. Commemorates the assassination of the Jewish governor of Judah","Tzom Tammuz":"Fast commemorating breaching of the walls of Jerusalem before the destruction of the Second Temple","Yom HaAliyah":"Recognizes Aliyah, immigration to the Jewish State of Israel","Yom HaAliyah School Observance":"Aliyah Day observed in Israeli schools","Yom HaAtzma'ut":"Israeli Independence Day. Commemorates the declaration of independence of Israel in 1948. Although Yom HaAtzma'ut is normally observed on the 5th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaZikaron, which always precedes it) would conflict with Shabbat","Yom HaShoah":"Holocaust Memorial Day","Yom HaZikaron":"Israeli Memorial Day. Remembers those who died in the War of Independence and other wars in Israel. The full name of the holiday is Yom HaZikaron LeHalalei Ma'arakhot Yisrael ul'Nifge'ei Pe'ulot HaEivah (Hebrew: יוֹם הזִּכָּרוֹן לְחַלְלֵי מַעֲרָכוֹת יִשְׂרָאֵל וּלְנִפְגְעֵי פְּעֻלּוֹת הָאֵיבָה), Memorial Day for the Fallen Soldiers of the Wars of Israel and Victims of Actions of Terrorism. Although Yom Hazikaron is normally observed on the 4th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaAtzma'ut, which always follows it) would conflict with Shabbat","Yom Kippur":"Day of Atonement","Yom Kippur Katan":"Minor day of atonement occurring monthly on the day preceeding each Rosh Chodesh","Yom Yerushalayim":"Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"};
|
|
30
11
|
|
|
@@ -142,17 +123,6 @@ function pad4(number) {
|
|
|
142
123
|
|
|
143
124
|
return '' + number;
|
|
144
125
|
}
|
|
145
|
-
/**
|
|
146
|
-
* Get offset string (like "+05:00" or "-08:00") from tzid (like "Europe/Moscow")
|
|
147
|
-
* @deprecated
|
|
148
|
-
* @param {string} tzid
|
|
149
|
-
* @param {Date} date
|
|
150
|
-
* @return {string}
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
function timeZoneOffsetStr(tzid, date) {
|
|
154
|
-
return core.Zmanim.timeZoneOffset(tzid, date);
|
|
155
|
-
}
|
|
156
126
|
/**
|
|
157
127
|
* Returns just the date portion as YYYY-MM-DD
|
|
158
128
|
* @param {Date} d
|
|
@@ -162,20 +132,6 @@ function timeZoneOffsetStr(tzid, date) {
|
|
|
162
132
|
function toISOString(d) {
|
|
163
133
|
return pad4(d.getFullYear()) + '-' + pad2(d.getMonth() + 1) + '-' + pad2(d.getDate());
|
|
164
134
|
}
|
|
165
|
-
/**
|
|
166
|
-
* Returns a string like "2018-09-01T12:30:00-05:00"
|
|
167
|
-
* @deprecated
|
|
168
|
-
* @param {Date} date
|
|
169
|
-
* @param {string} timeStr must be formatted with only hours and minutes, like "17:12"
|
|
170
|
-
* @param {string} tzid like "America/New_York"
|
|
171
|
-
* @return {string}
|
|
172
|
-
*/
|
|
173
|
-
|
|
174
|
-
function toISOStringWithTimezone(date, timeStr, tzid) {
|
|
175
|
-
const str = toISOString(date);
|
|
176
|
-
if (!timeStr) return str;
|
|
177
|
-
return str + 'T' + timeStr + ':00' + core.Zmanim.timeZoneOffset(tzid, date);
|
|
178
|
-
}
|
|
179
135
|
/**
|
|
180
136
|
* Returns a category and subcategory name
|
|
181
137
|
* @param {Event} ev
|
|
@@ -356,7 +312,7 @@ function makeTorahMemoText(ev, il) {
|
|
|
356
312
|
return '';
|
|
357
313
|
}
|
|
358
314
|
|
|
359
|
-
const reading = mask & core.flags.PARSHA_HASHAVUA ?
|
|
315
|
+
const reading = mask & core.flags.PARSHA_HASHAVUA ? leyning.getLeyningForParshaHaShavua(ev, il) : leyning.getLeyningForHoliday(ev, il);
|
|
360
316
|
let memo = '';
|
|
361
317
|
|
|
362
318
|
if (reading && (reading.summary || reading.haftara)) {
|
|
@@ -611,7 +567,7 @@ function eventsToClassicApi(events, options, leyning = true) {
|
|
|
611
567
|
* @return {Object}
|
|
612
568
|
*/
|
|
613
569
|
|
|
614
|
-
function eventToClassicApiObject(ev, options, leyning = true) {
|
|
570
|
+
function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
615
571
|
const timed = Boolean(ev.eventTime);
|
|
616
572
|
const hd = ev.getDate();
|
|
617
573
|
const dt = hd.greg();
|
|
@@ -658,20 +614,20 @@ function eventToClassicApiObject(ev, options, leyning = true) {
|
|
|
658
614
|
}
|
|
659
615
|
|
|
660
616
|
if (!candles) {
|
|
661
|
-
if (leyning) {
|
|
617
|
+
if (leyning$1) {
|
|
662
618
|
const il = options.il;
|
|
663
619
|
const isParsha = mask === core.flags.PARSHA_HASHAVUA;
|
|
664
|
-
const reading = isParsha ?
|
|
620
|
+
const reading = isParsha ? leyning.getLeyningForParshaHaShavua(ev, il) : leyning.getLeyningForHoliday(ev, il);
|
|
665
621
|
|
|
666
622
|
if (reading) {
|
|
667
623
|
result.leyning = formatLeyningResult(reading);
|
|
668
624
|
const hyear = hd.getFullYear();
|
|
669
625
|
|
|
670
626
|
if (isParsha && !il && hyear >= 5745) {
|
|
671
|
-
const triReading =
|
|
627
|
+
const triReading = triennial.getTriennialForParshaHaShavua(ev);
|
|
672
628
|
|
|
673
629
|
if (triReading) {
|
|
674
|
-
result.leyning.triennial = formatAliyot({}, triReading);
|
|
630
|
+
result.leyning.triennial = formatAliyot({}, triReading.aliyot);
|
|
675
631
|
}
|
|
676
632
|
}
|
|
677
633
|
}
|
|
@@ -738,13 +694,13 @@ function formatAliyot(result, aliyot) {
|
|
|
738
694
|
|
|
739
695
|
if (typeof aliyah !== 'undefined') {
|
|
740
696
|
const k = num == 'M' ? 'maftir' : num;
|
|
741
|
-
result[k] =
|
|
697
|
+
result[k] = leyning.formatAliyahWithBook(aliyah);
|
|
742
698
|
}
|
|
743
699
|
});
|
|
744
700
|
return result;
|
|
745
701
|
}
|
|
746
702
|
/**
|
|
747
|
-
* @param {
|
|
703
|
+
* @param {Leyning} reading
|
|
748
704
|
* @return {Object}
|
|
749
705
|
*/
|
|
750
706
|
|
|
@@ -818,32 +774,7 @@ function getLinkAndGuid(ev, il, tzid, mainUrl, utmSource, utmMedium) {
|
|
|
818
774
|
|
|
819
775
|
return [link, guid];
|
|
820
776
|
}
|
|
821
|
-
/**
|
|
822
|
-
* @param {Event[]} events
|
|
823
|
-
* @param {Location} location
|
|
824
|
-
* @param {string} mainUrl
|
|
825
|
-
* @param {string} selfUrl
|
|
826
|
-
* @param {string} [lang] language such as 'he' (default 'en-US')
|
|
827
|
-
* @param {boolean} [evPubDate] if true, use event time as pubDate (false uses lastBuildDate)
|
|
828
|
-
* @return {string}
|
|
829
|
-
*/
|
|
830
|
-
|
|
831
777
|
|
|
832
|
-
function eventsToRss(events, location, mainUrl, selfUrl, lang = 'en-US', evPubDate = true) {
|
|
833
|
-
const cityDescr = location.getName();
|
|
834
|
-
const options = {
|
|
835
|
-
location,
|
|
836
|
-
mainUrl,
|
|
837
|
-
selfUrl,
|
|
838
|
-
lang,
|
|
839
|
-
evPubDate,
|
|
840
|
-
title: core.Locale.gettext('Shabbat') + ` Times for ${cityDescr}`,
|
|
841
|
-
description: `Weekly Shabbat candle lighting times for ${cityDescr}`,
|
|
842
|
-
utmSource: 'shabbat1c',
|
|
843
|
-
utmMedium: 'rss'
|
|
844
|
-
};
|
|
845
|
-
return eventsToRss2(events, options);
|
|
846
|
-
}
|
|
847
778
|
const localeToLg = {
|
|
848
779
|
's': 'en',
|
|
849
780
|
'a': 'en',
|
|
@@ -924,28 +855,15 @@ function getPubDate(ev, evPubDate, evDate, lastBuildDate) {
|
|
|
924
855
|
|
|
925
856
|
|
|
926
857
|
function eventToRssItem2(ev, options) {
|
|
927
|
-
return eventToRssItem(ev, options.evPubDate, options.lastBuildDate, options.dayFormat, options.location, options.mainUrl, options);
|
|
928
|
-
}
|
|
929
|
-
/**
|
|
930
|
-
* @param {Event} ev
|
|
931
|
-
* @param {boolean} evPubDate
|
|
932
|
-
* @param {string} lastBuildDate
|
|
933
|
-
* @param {Intl.DateTimeFormat} dayFormat
|
|
934
|
-
* @param {Location} location
|
|
935
|
-
* @param {string} mainUrl
|
|
936
|
-
* @param {CalOptions} [options]
|
|
937
|
-
* @return {string}
|
|
938
|
-
*/
|
|
939
|
-
|
|
940
|
-
function eventToRssItem(ev, evPubDate, lastBuildDate, dayFormat, location, mainUrl, options) {
|
|
941
858
|
let subj = ev.render();
|
|
942
859
|
const evDate = ev.getDate().greg();
|
|
943
|
-
const pubDate = getPubDate(ev, evPubDate, evDate, lastBuildDate);
|
|
860
|
+
const pubDate = getPubDate(ev, options.evPubDate, evDate, options.lastBuildDate);
|
|
861
|
+
const location = options.location;
|
|
944
862
|
const il = location ? location.getIsrael() : false;
|
|
945
863
|
const tzid = location ? location.getTzid() : 'UTC';
|
|
946
864
|
const utmSource = options && options.utmSource || 'shabbat1c';
|
|
947
865
|
const utmMedium = options && options.utmMedium || 'rss';
|
|
948
|
-
const linkGuid = getLinkAndGuid(ev, il, tzid, mainUrl, utmSource, utmMedium);
|
|
866
|
+
const linkGuid = getLinkAndGuid(ev, il, tzid, options.mainUrl, utmSource, utmMedium);
|
|
949
867
|
const link = linkGuid[0];
|
|
950
868
|
const guid = linkGuid[1];
|
|
951
869
|
const categories = getEventCategories(ev);
|
|
@@ -970,6 +888,7 @@ function eventToRssItem(ev, evPubDate, lastBuildDate, dayFormat, location, mainU
|
|
|
970
888
|
memo = ev.getFlags() & core.flags.PARSHA_HASHAVUA ? makeTorahMemoText(ev, il) : ev.memo || holidayDescription[ev.basename()];
|
|
971
889
|
}
|
|
972
890
|
|
|
891
|
+
const dayFormat = options.dayFormat;
|
|
973
892
|
const description = memo || dayFormat.format(evDate);
|
|
974
893
|
const geoTags = cat0 == 'candles' ? `<geo:lat>${location.getLatitude()}</geo:lat>\n<geo:long>${location.getLongitude()}</geo:long>\n` : '';
|
|
975
894
|
return `<item>
|
|
@@ -1041,11 +960,9 @@ exports.countryNames = countryNames;
|
|
|
1041
960
|
exports.eventToClassicApiObject = eventToClassicApiObject;
|
|
1042
961
|
exports.eventToCsv = eventToCsv;
|
|
1043
962
|
exports.eventToFullCalendar = eventToFullCalendar;
|
|
1044
|
-
exports.eventToRssItem = eventToRssItem;
|
|
1045
963
|
exports.eventToRssItem2 = eventToRssItem2;
|
|
1046
964
|
exports.eventsToClassicApi = eventsToClassicApi;
|
|
1047
965
|
exports.eventsToCsv = eventsToCsv;
|
|
1048
|
-
exports.eventsToRss = eventsToRss;
|
|
1049
966
|
exports.eventsToRss2 = eventsToRss2;
|
|
1050
967
|
exports.getCalendarTitle = getCalendarTitle;
|
|
1051
968
|
exports.getDownloadFilename = getDownloadFilename;
|
|
@@ -1059,6 +976,4 @@ exports.pad2 = pad2;
|
|
|
1059
976
|
exports.pad4 = pad4;
|
|
1060
977
|
exports.renderTitleWithoutTime = renderTitleWithoutTime;
|
|
1061
978
|
exports.shouldRenderBrief = shouldRenderBrief;
|
|
1062
|
-
exports.timeZoneOffsetStr = timeZoneOffsetStr;
|
|
1063
979
|
exports.toISOString = toISOString;
|
|
1064
|
-
exports.toISOStringWithTimezone = toISOStringWithTimezone;
|