@hebcal/rest-api 5.0.0 → 5.0.2
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/dist/bundle.js +353 -67
- package/dist/bundle.min.js +2 -2
- package/dist/fullcalendar.js +110 -38
- package/dist/fullcalendar.min.js +2 -2
- package/dist/{index.js → index.cjs} +353 -64
- package/dist/index.mjs +353 -64
- package/package.json +19 -21
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,278 @@
|
|
|
1
|
-
/*! @hebcal/rest-api v5.0.
|
|
1
|
+
/*! @hebcal/rest-api v5.0.2 */
|
|
2
2
|
import { flags, HDate, HebrewCalendar, Zmanim, Locale, gematriya } from '@hebcal/core';
|
|
3
3
|
import { getLeyningForParshaHaShavua, getLeyningForHoliday, formatAliyahWithBook } from '@hebcal/leyning';
|
|
4
4
|
import { getTriennialForParshaHaShavua } from '@hebcal/triennial';
|
|
5
5
|
|
|
6
|
-
const Chanukah="Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights, the eight-day festival is observed by lighting the candles of a hanukkiah (menorah)";const 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";const 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";const Shavuot="Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai";const Sigd="Ethiopian Jewish holiday occurring 50 days after Yom Kippur";const Sukkot="Feast of Booths. Also called the Feast of Tabernacles, the seven-day holiday is one of the Three Pilgrimage Festivals (Hebrew: שלוש רגלים, shalosh regalim)";var holidayDescription = {"Asara B'Tevet":"Fast commemorating the siege of Jerusalem","Ben-Gurion Day":"Commemorates the life and vision of Israel's first Prime Minister David Ben-Gurion","Birkat Hachamah":"A rare Jewish blessing recited once every 28 years thanking G-d for creating the sun","Chag HaBanot":"North African Chanukah festival of daughters. Called Eid al-Banat in Arabic, the holiday was most preserved in Tunisia",Chanukah:Chanukah,"Days of the Omer":"7 weeks from the second night of Pesach to the day before Shavuot. Also called Sefirat HaOmer, it is a practice that consists of a verbal counting of each of the forty-nine days between the two holidays","Family Day":"Yom HaMishpacha, a day to honor the family unit","Herzl Day":"Commemorates the life and vision of Zionist leader Theodor Herzl","Jabotinsky Day":"Commemorates the life and vision of Zionist leader Ze'ev Jabotinsky","Lag BaOmer":"33rd day of counting the Omer. The holiday is a temporary break from the semi-mourning period the counting of the Omer. Practices include lighting bonfires, getting haircuts, and Jewish weddings","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,"Purim Meshulash":"Triple Purim, spanning 3 days in Jerusalem and walled cities. It occurs when the 15th of Adar coincides with Shabbat","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 of Prophecy/Shabbat of Vision. Shabbat before Tish'a B'Av","Shabbat HaChodesh":"Shabbat before Rosh Chodesh Nissan. Read in preparation for Passover","Shabbat HaGadol":"Shabbat before Pesach (The Great Shabbat)","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 before Shabbat HaChodesh, in preparation for Passover","Shabbat Rosh Chodesh":"When Shabbat falls on Rosh Chodesh","Shabbat Shekalim":"Shabbat before Rosh Chodesh Adar. Read in preparation for Purim","Shabbat Shirah":"Shabbat of Song. Shabbat that includes Parashat Beshalach","Shabbat Shuva":"Shabbat of Returning. Shabbat that occurs during the Ten Days of Repentance between Rosh Hashanah and Yom Kippur","Shabbat Zachor":"Shabbat of Remembrance. Shabbat before Purim",Shavuot:Shavuot,"Shmini Atzeret":"Eighth Day of Assembly. Immediately following Sukkot, it is observed as a separate holiday in the Diaspora and is combined with Simchat Torah in Israel","Shushan Purim":"Purim celebrated in Jerusalem and walled cities","Shushan Purim Katan":"Minor Purim celebration during Adar I on leap years in Jerusalem and walled cities",Sigd:Sigd,"Simchat Torah":"Day of Celebrating the Torah. Celebration marking the conclusion of the annual cycle of public Torah readings, and the beginning of a new cycle",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. Tu BiShvat is one of four “New Years” mentioned in the Mishnah","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","Yitzhak Rabin Memorial Day":"Commemorates the life of Israeli Prime Minister Yitzhak Rabin","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. The holiest day of the year in Judaism, traditionally observed with a 25-hour period of fasting and intensive prayer","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
|
+
var holidayDescription = {
|
|
7
|
+
"Asara B'Tevet": "Fast commemorating the siege of Jerusalem",
|
|
8
|
+
"Ben-Gurion Day": "Commemorates the life and vision of Israel's first Prime Minister David Ben-Gurion",
|
|
9
|
+
"Birkat Hachamah": "A rare Jewish blessing recited once every 28 years thanking G-d for creating the sun",
|
|
10
|
+
"Chag HaBanot": "North African Chanukah festival of daughters. Called Eid al-Banat in Arabic, the holiday was most preserved in Tunisia",
|
|
11
|
+
"Chanukah": "Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights, the eight-day festival is observed by lighting the candles of a hanukkiah (menorah)",
|
|
12
|
+
"Days of the Omer": "7 weeks from the second night of Pesach to the day before Shavuot. Also called Sefirat HaOmer, it is a practice that consists of a verbal counting of each of the forty-nine days between the two holidays",
|
|
13
|
+
"Family Day": "Yom HaMishpacha, a day to honor the family unit",
|
|
14
|
+
"Herzl Day": "Commemorates the life and vision of Zionist leader Theodor Herzl",
|
|
15
|
+
"Jabotinsky Day": "Commemorates the life and vision of Zionist leader Ze'ev Jabotinsky",
|
|
16
|
+
"Lag BaOmer": "33rd day of counting the Omer. The holiday is a temporary break from the semi-mourning period the counting of the Omer. Practices include lighting bonfires, getting haircuts, and Jewish weddings",
|
|
17
|
+
"Leil Selichot": "Prayers for forgiveness in preparation for the High Holidays",
|
|
18
|
+
"Pesach Sheni": "Second Passover, one month after Passover",
|
|
19
|
+
"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",
|
|
20
|
+
"Purim Katan": "Minor Purim celebration during Adar I on leap years",
|
|
21
|
+
"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",
|
|
22
|
+
"Purim Meshulash": "Triple Purim, spanning 3 days in Jerusalem and walled cities. It occurs when the 15th of Adar coincides with Shabbat",
|
|
23
|
+
"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",
|
|
24
|
+
"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",
|
|
25
|
+
"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",
|
|
26
|
+
"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",
|
|
27
|
+
"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",
|
|
28
|
+
"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",
|
|
29
|
+
"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",
|
|
30
|
+
"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",
|
|
31
|
+
"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",
|
|
32
|
+
"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",
|
|
33
|
+
"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",
|
|
34
|
+
"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",
|
|
35
|
+
"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",
|
|
36
|
+
"Rosh Hashana": "The Jewish New Year. Also spelled Rosh Hashanah",
|
|
37
|
+
"Rosh Hashana LaBehemot": "New Year for Tithing Animals",
|
|
38
|
+
"Shabbat Chazon": "Shabbat of Prophecy/Shabbat of Vision. Shabbat before Tish'a B'Av",
|
|
39
|
+
"Shabbat HaChodesh": "Shabbat before Rosh Chodesh Nissan. Read in preparation for Passover",
|
|
40
|
+
"Shabbat HaGadol": "Shabbat before Pesach (The Great Shabbat)",
|
|
41
|
+
"Shabbat Machar Chodesh": "When Shabbat falls the day before Rosh Chodesh",
|
|
42
|
+
"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\")",
|
|
43
|
+
"Shabbat Parah": "Shabbat of the Red Heifer. Shabbat before Shabbat HaChodesh, in preparation for Passover",
|
|
44
|
+
"Shabbat Rosh Chodesh": "When Shabbat falls on Rosh Chodesh",
|
|
45
|
+
"Shabbat Shekalim": "Shabbat before Rosh Chodesh Adar. Read in preparation for Purim",
|
|
46
|
+
"Shabbat Shirah": "Shabbat of Song. Shabbat that includes Parashat Beshalach",
|
|
47
|
+
"Shabbat Shuva": "Shabbat of Returning. Shabbat that occurs during the Ten Days of Repentance between Rosh Hashanah and Yom Kippur",
|
|
48
|
+
"Shabbat Zachor": "Shabbat of Remembrance. Shabbat before Purim",
|
|
49
|
+
"Shavuot": "Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai",
|
|
50
|
+
"Shmini Atzeret": "Eighth Day of Assembly. Immediately following Sukkot, it is observed as a separate holiday in the Diaspora and is combined with Simchat Torah in Israel",
|
|
51
|
+
"Shushan Purim": "Purim celebrated in Jerusalem and walled cities",
|
|
52
|
+
"Shushan Purim Katan": "Minor Purim celebration during Adar I on leap years in Jerusalem and walled cities",
|
|
53
|
+
"Sigd": "Ethiopian Jewish holiday occurring 50 days after Yom Kippur",
|
|
54
|
+
"Simchat Torah": "Day of Celebrating the Torah. Celebration marking the conclusion of the annual cycle of public Torah readings, and the beginning of a new cycle",
|
|
55
|
+
"Sukkot": "Feast of Booths. Also called the Feast of Tabernacles, the seven-day holiday is one of the Three Pilgrimage Festivals (Hebrew: שלוש רגלים, shalosh regalim)",
|
|
56
|
+
"Ta'anit Bechorot": "Fast of the First Born",
|
|
57
|
+
"Ta'anit Esther": "Fast of Esther",
|
|
58
|
+
"Tish'a B'Av": "The Ninth of Av. Fast commemorating the destruction of the two Temples",
|
|
59
|
+
"Tu B'Av": "Minor Jewish holiday of love. Observed on the 15th day of the Hebrew month of Av",
|
|
60
|
+
"Tu BiShvat": "New Year for Trees. Tu BiShvat is one of four “New Years” mentioned in the Mishnah",
|
|
61
|
+
"Tzom Gedaliah": "Fast of the Seventh Month. Commemorates the assassination of the Jewish governor of Judah",
|
|
62
|
+
"Tzom Tammuz": "Fast commemorating breaching of the walls of Jerusalem before the destruction of the Second Temple",
|
|
63
|
+
"Yitzhak Rabin Memorial Day": "Commemorates the life of Israeli Prime Minister Yitzhak Rabin",
|
|
64
|
+
"Yom HaAliyah": "Recognizes Aliyah, immigration to the Jewish State of Israel",
|
|
65
|
+
"Yom HaAliyah School Observance": "Aliyah Day observed in Israeli schools",
|
|
66
|
+
"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",
|
|
67
|
+
"Yom HaShoah": "Holocaust Memorial Day",
|
|
68
|
+
"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",
|
|
69
|
+
"Yom Kippur": "Day of Atonement. The holiest day of the year in Judaism, traditionally observed with a 25-hour period of fasting and intensive prayer",
|
|
70
|
+
"Yom Kippur Katan": "Minor day of atonement occurring monthly on the day preceeding each Rosh Chodesh",
|
|
71
|
+
"Yom Yerushalayim": "Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"
|
|
72
|
+
};
|
|
7
73
|
|
|
8
|
-
|
|
74
|
+
var countryNames = {
|
|
75
|
+
"AD": "Andorra",
|
|
76
|
+
"AE": "United Arab Emirates",
|
|
77
|
+
"AF": "Afghanistan",
|
|
78
|
+
"AI": "Anguilla",
|
|
79
|
+
"AL": "Albania",
|
|
80
|
+
"AM": "Armenia",
|
|
81
|
+
"AO": "Angola",
|
|
82
|
+
"AR": "Argentina",
|
|
83
|
+
"AS": "American Samoa",
|
|
84
|
+
"AT": "Austria",
|
|
85
|
+
"AU": "Australia",
|
|
86
|
+
"AW": "Aruba",
|
|
87
|
+
"AZ": "Azerbaijan",
|
|
88
|
+
"BA": "Bosnia and Herzegovina",
|
|
89
|
+
"BB": "Barbados",
|
|
90
|
+
"BD": "Bangladesh",
|
|
91
|
+
"BE": "Belgium",
|
|
92
|
+
"BF": "Burkina Faso",
|
|
93
|
+
"BG": "Bulgaria",
|
|
94
|
+
"BH": "Bahrain",
|
|
95
|
+
"BI": "Burundi",
|
|
96
|
+
"BJ": "Benin",
|
|
97
|
+
"BM": "Bermuda",
|
|
98
|
+
"BN": "Brunei",
|
|
99
|
+
"BO": "Bolivia",
|
|
100
|
+
"BR": "Brazil",
|
|
101
|
+
"BS": "Bahamas",
|
|
102
|
+
"BT": "Bhutan",
|
|
103
|
+
"BW": "Botswana",
|
|
104
|
+
"BY": "Belarus",
|
|
105
|
+
"BZ": "Belize",
|
|
106
|
+
"CA": "Canada",
|
|
107
|
+
"CD": "Democratic Republic of the Congo",
|
|
108
|
+
"CF": "Central African Republic",
|
|
109
|
+
"CG": "Republic of the Congo",
|
|
110
|
+
"CH": "Switzerland",
|
|
111
|
+
"CI": "Ivory Coast",
|
|
112
|
+
"CK": "Cook Islands",
|
|
113
|
+
"CL": "Chile",
|
|
114
|
+
"CM": "Cameroon",
|
|
115
|
+
"CN": "China",
|
|
116
|
+
"CO": "Colombia",
|
|
117
|
+
"CR": "Costa Rica",
|
|
118
|
+
"CU": "Cuba",
|
|
119
|
+
"CV": "Cape Verde",
|
|
120
|
+
"CW": "Curacao",
|
|
121
|
+
"CY": "Cyprus",
|
|
122
|
+
"CZ": "Czech Republic",
|
|
123
|
+
"DE": "Germany",
|
|
124
|
+
"DK": "Denmark",
|
|
125
|
+
"DM": "Dominica",
|
|
126
|
+
"DO": "Dominican Republic",
|
|
127
|
+
"DZ": "Algeria",
|
|
128
|
+
"EC": "Ecuador",
|
|
129
|
+
"EE": "Estonia",
|
|
130
|
+
"EG": "Egypt",
|
|
131
|
+
"ER": "Eritrea",
|
|
132
|
+
"ES": "Spain",
|
|
133
|
+
"ET": "Ethiopia",
|
|
134
|
+
"FI": "Finland",
|
|
135
|
+
"FJ": "Fiji",
|
|
136
|
+
"FK": "Falkland Islands",
|
|
137
|
+
"FO": "Faroe Islands",
|
|
138
|
+
"FR": "France",
|
|
139
|
+
"GA": "Gabon",
|
|
140
|
+
"GB": "United Kingdom",
|
|
141
|
+
"GE": "Georgia",
|
|
142
|
+
"GH": "Ghana",
|
|
143
|
+
"GI": "Gibraltar",
|
|
144
|
+
"GL": "Greenland",
|
|
145
|
+
"GM": "Gambia",
|
|
146
|
+
"GN": "Guinea",
|
|
147
|
+
"GQ": "Equatorial Guinea",
|
|
148
|
+
"GR": "Greece",
|
|
149
|
+
"GT": "Guatemala",
|
|
150
|
+
"GW": "Guinea-Bissau",
|
|
151
|
+
"GY": "Guyana",
|
|
152
|
+
"HK": "Hong Kong",
|
|
153
|
+
"HN": "Honduras",
|
|
154
|
+
"HR": "Croatia",
|
|
155
|
+
"HT": "Haiti",
|
|
156
|
+
"HU": "Hungary",
|
|
157
|
+
"ID": "Indonesia",
|
|
158
|
+
"IE": "Ireland",
|
|
159
|
+
"IL": "Israel",
|
|
160
|
+
"IM": "Isle of Man",
|
|
161
|
+
"IN": "India",
|
|
162
|
+
"IQ": "Iraq",
|
|
163
|
+
"IR": "Iran",
|
|
164
|
+
"IS": "Iceland",
|
|
165
|
+
"IT": "Italy",
|
|
166
|
+
"JM": "Jamaica",
|
|
167
|
+
"JO": "Jordan",
|
|
168
|
+
"JP": "Japan",
|
|
169
|
+
"KE": "Kenya",
|
|
170
|
+
"KG": "Kyrgyzstan",
|
|
171
|
+
"KH": "Cambodia",
|
|
172
|
+
"KM": "Comoros",
|
|
173
|
+
"KN": "Saint Kitts and Nevis",
|
|
174
|
+
"KP": "North Korea",
|
|
175
|
+
"KR": "South Korea",
|
|
176
|
+
"KW": "Kuwait",
|
|
177
|
+
"KY": "Cayman Islands",
|
|
178
|
+
"KZ": "Kazakhstan",
|
|
179
|
+
"LA": "Laos",
|
|
180
|
+
"LB": "Lebanon",
|
|
181
|
+
"LC": "Saint Lucia",
|
|
182
|
+
"LI": "Liechtenstein",
|
|
183
|
+
"LR": "Liberia",
|
|
184
|
+
"LS": "Lesotho",
|
|
185
|
+
"LT": "Lithuania",
|
|
186
|
+
"LU": "Luxembourg",
|
|
187
|
+
"LV": "Latvia",
|
|
188
|
+
"LY": "Libya",
|
|
189
|
+
"MA": "Morocco",
|
|
190
|
+
"MD": "Moldova",
|
|
191
|
+
"ME": "Montenegro",
|
|
192
|
+
"MG": "Madagascar",
|
|
193
|
+
"MK": "Macedonia",
|
|
194
|
+
"ML": "Mali",
|
|
195
|
+
"MM": "Myanmar",
|
|
196
|
+
"MN": "Mongolia",
|
|
197
|
+
"MP": "Northern Mariana Islands",
|
|
198
|
+
"MR": "Mauritania",
|
|
199
|
+
"MS": "Montserrat",
|
|
200
|
+
"MT": "Malta",
|
|
201
|
+
"MU": "Mauritius",
|
|
202
|
+
"MW": "Malawi",
|
|
203
|
+
"MX": "Mexico",
|
|
204
|
+
"MY": "Malaysia",
|
|
205
|
+
"MZ": "Mozambique",
|
|
206
|
+
"NA": "Namibia",
|
|
207
|
+
"NC": "New Caledonia",
|
|
208
|
+
"NE": "Niger",
|
|
209
|
+
"NG": "Nigeria",
|
|
210
|
+
"NI": "Nicaragua",
|
|
211
|
+
"NL": "Netherlands",
|
|
212
|
+
"NO": "Norway",
|
|
213
|
+
"NP": "Nepal",
|
|
214
|
+
"NU": "Niue",
|
|
215
|
+
"NZ": "New Zealand",
|
|
216
|
+
"OM": "Oman",
|
|
217
|
+
"PA": "Panama",
|
|
218
|
+
"PE": "Peru",
|
|
219
|
+
"PF": "French Polynesia",
|
|
220
|
+
"PG": "Papua New Guinea",
|
|
221
|
+
"PH": "Philippines",
|
|
222
|
+
"PK": "Pakistan",
|
|
223
|
+
"PL": "Poland",
|
|
224
|
+
"PR": "Puerto Rico",
|
|
225
|
+
"PT": "Portugal",
|
|
226
|
+
"PY": "Paraguay",
|
|
227
|
+
"QA": "Qatar",
|
|
228
|
+
"RO": "Romania",
|
|
229
|
+
"RS": "Serbia",
|
|
230
|
+
"RU": "Russia",
|
|
231
|
+
"RW": "Rwanda",
|
|
232
|
+
"SA": "Saudi Arabia",
|
|
233
|
+
"SB": "Solomon Islands",
|
|
234
|
+
"SC": "Seychelles",
|
|
235
|
+
"SD": "Sudan",
|
|
236
|
+
"SE": "Sweden",
|
|
237
|
+
"SG": "Singapore",
|
|
238
|
+
"SH": "Saint Helena",
|
|
239
|
+
"SI": "Slovenia",
|
|
240
|
+
"SK": "Slovakia",
|
|
241
|
+
"SL": "Sierra Leone",
|
|
242
|
+
"SN": "Senegal",
|
|
243
|
+
"SO": "Somalia",
|
|
244
|
+
"SR": "Suriname",
|
|
245
|
+
"ST": "Sao Tome and Principe",
|
|
246
|
+
"SV": "El Salvador",
|
|
247
|
+
"SY": "Syria",
|
|
248
|
+
"SZ": "Swaziland",
|
|
249
|
+
"TC": "Turks and Caicos Islands",
|
|
250
|
+
"TD": "Chad",
|
|
251
|
+
"TG": "Togo",
|
|
252
|
+
"TH": "Thailand",
|
|
253
|
+
"TJ": "Tajikistan",
|
|
254
|
+
"TM": "Turkmenistan",
|
|
255
|
+
"TN": "Tunisia",
|
|
256
|
+
"TR": "Turkey",
|
|
257
|
+
"TV": "Tuvalu",
|
|
258
|
+
"TW": "Taiwan",
|
|
259
|
+
"TZ": "Tanzania",
|
|
260
|
+
"UA": "Ukraine",
|
|
261
|
+
"UG": "Uganda",
|
|
262
|
+
"US": "United States",
|
|
263
|
+
"UY": "Uruguay",
|
|
264
|
+
"UZ": "Uzbekistan",
|
|
265
|
+
"VC": "Saint Vincent and the Grenadines",
|
|
266
|
+
"VE": "Venezuela",
|
|
267
|
+
"VG": "British Virgin Islands",
|
|
268
|
+
"VN": "Vietnam",
|
|
269
|
+
"WS": "Samoa",
|
|
270
|
+
"YE": "Yemen",
|
|
271
|
+
"YT": "Mayotte",
|
|
272
|
+
"ZA": "South Africa",
|
|
273
|
+
"ZM": "Zambia",
|
|
274
|
+
"ZW": "Zimbabwe"
|
|
275
|
+
};
|
|
9
276
|
|
|
10
277
|
/**
|
|
11
278
|
* Location information
|
|
@@ -26,6 +293,8 @@ const AD="Andorra";const AE="United Arab Emirates";const AF="Afghanistan";const
|
|
|
26
293
|
* @property {number} geonameid
|
|
27
294
|
*/
|
|
28
295
|
|
|
296
|
+
const LOC_FIELDS = ['elevation', 'admin1', 'asciiname', 'geo', 'zip', 'state', 'stateName', 'geonameid'];
|
|
297
|
+
|
|
29
298
|
/**
|
|
30
299
|
* Converts a @hebcal/core `Location` to a plain JS object.
|
|
31
300
|
* @param {Location} location
|
|
@@ -40,18 +309,16 @@ function locationToPlainObj(location) {
|
|
|
40
309
|
latitude: location.getLatitude(),
|
|
41
310
|
longitude: location.getLongitude(),
|
|
42
311
|
cc: location.getCountryCode(),
|
|
43
|
-
country: countryNames[location.getCountryCode()]
|
|
312
|
+
country: countryNames[location.getCountryCode()],
|
|
44
313
|
};
|
|
45
|
-
|
|
314
|
+
for (const k of LOC_FIELDS) {
|
|
46
315
|
if (location[k]) {
|
|
47
316
|
o[k] = location[k];
|
|
48
317
|
}
|
|
49
|
-
}
|
|
318
|
+
}
|
|
50
319
|
return o;
|
|
51
320
|
} else {
|
|
52
|
-
return {
|
|
53
|
-
geo: 'none'
|
|
54
|
-
};
|
|
321
|
+
return {geo: 'none'};
|
|
55
322
|
}
|
|
56
323
|
}
|
|
57
324
|
|
|
@@ -64,7 +331,12 @@ function locationToPlainObj(location) {
|
|
|
64
331
|
* @return {string}
|
|
65
332
|
*/
|
|
66
333
|
function makeAnchor(s) {
|
|
67
|
-
return s.toLowerCase()
|
|
334
|
+
return s.toLowerCase()
|
|
335
|
+
.replace(/'/g, '')
|
|
336
|
+
.replace(/[^\w]/g, '-')
|
|
337
|
+
.replace(/-+/g, '-')
|
|
338
|
+
.replace(/^-/g, '')
|
|
339
|
+
.replace(/-$/g, '');
|
|
68
340
|
}
|
|
69
341
|
|
|
70
342
|
/**
|
|
@@ -170,12 +442,12 @@ function renderTitleWithoutTime(ev) {
|
|
|
170
442
|
function getCalendarTitle(events, options) {
|
|
171
443
|
let title = 'Hebcal';
|
|
172
444
|
const location = options.location;
|
|
173
|
-
const locationName = location
|
|
445
|
+
const locationName = location?.getName();
|
|
174
446
|
if (options.yahrzeit) {
|
|
175
447
|
title += ' Yahrzeits and Anniversaries';
|
|
176
448
|
} else if (locationName) {
|
|
177
449
|
const comma = locationName.indexOf(',');
|
|
178
|
-
const name = comma == -1 ? locationName : locationName.substring(0, comma);
|
|
450
|
+
const name = (comma == -1) ? locationName : locationName.substring(0, comma);
|
|
179
451
|
title += ' ' + name;
|
|
180
452
|
} else if (options.il) {
|
|
181
453
|
title += ' Israel';
|
|
@@ -193,9 +465,7 @@ function getCalendarTitle(events, options) {
|
|
|
193
465
|
if (start.getFullYear() != end.getFullYear()) {
|
|
194
466
|
title += ' ' + start.getFullYear() + '-' + end.getFullYear();
|
|
195
467
|
} else if (start.getMonth() == end.getMonth()) {
|
|
196
|
-
const monthFormat = new Intl.DateTimeFormat('en-US', {
|
|
197
|
-
month: 'long'
|
|
198
|
-
});
|
|
468
|
+
const monthFormat = new Intl.DateTimeFormat('en-US', {month: 'long'});
|
|
199
469
|
const startMonth = monthFormat.format(start);
|
|
200
470
|
title += ' ' + startMonth + ' ' + start.getFullYear();
|
|
201
471
|
} else {
|
|
@@ -211,7 +481,7 @@ function getCalendarTitle(events, options) {
|
|
|
211
481
|
* @param {boolean} [firstSentence=false]
|
|
212
482
|
* @return {string}
|
|
213
483
|
*/
|
|
214
|
-
function getHolidayDescription(ev, firstSentence
|
|
484
|
+
function getHolidayDescription(ev, firstSentence=false) {
|
|
215
485
|
const str0 = holidayDescription[ev.getDesc()] || holidayDescription[ev.basename()] || '';
|
|
216
486
|
const str = str0.normalize();
|
|
217
487
|
if (firstSentence && str) {
|
|
@@ -222,7 +492,11 @@ function getHolidayDescription(ev, firstSentence = false) {
|
|
|
222
492
|
}
|
|
223
493
|
return str;
|
|
224
494
|
}
|
|
225
|
-
|
|
495
|
+
|
|
496
|
+
const HOLIDAY_IGNORE_MASK = flags.DAF_YOMI | flags.OMER_COUNT |
|
|
497
|
+
flags.SHABBAT_MEVARCHIM | flags.MOLAD | flags.USER_EVENT |
|
|
498
|
+
flags.NACH_YOMI |
|
|
499
|
+
flags.HEBREW_DATE | flags.YERUSHALMI_YOMI;
|
|
226
500
|
|
|
227
501
|
/**
|
|
228
502
|
* Makes mulit-line text that summarizes Torah & Haftarah
|
|
@@ -232,10 +506,12 @@ const HOLIDAY_IGNORE_MASK = flags.DAF_YOMI | flags.OMER_COUNT | flags.SHABBAT_ME
|
|
|
232
506
|
*/
|
|
233
507
|
function makeTorahMemoText(ev, il) {
|
|
234
508
|
const mask = ev.getFlags();
|
|
235
|
-
if (mask & HOLIDAY_IGNORE_MASK || typeof ev.eventTime !== 'undefined') {
|
|
509
|
+
if ((mask & HOLIDAY_IGNORE_MASK) || (typeof ev.eventTime !== 'undefined')) {
|
|
236
510
|
return '';
|
|
237
511
|
}
|
|
238
|
-
const reading = mask & flags.PARSHA_HASHAVUA ?
|
|
512
|
+
const reading = (mask & flags.PARSHA_HASHAVUA) ?
|
|
513
|
+
getLeyningForParshaHaShavua(ev, il) :
|
|
514
|
+
getLeyningForHoliday(ev, il);
|
|
239
515
|
let memo = '';
|
|
240
516
|
if (reading && (reading.summary || reading.haftara)) {
|
|
241
517
|
if (reading.summary) {
|
|
@@ -245,14 +521,13 @@ function makeTorahMemoText(ev, il) {
|
|
|
245
521
|
memo += '\n';
|
|
246
522
|
}
|
|
247
523
|
if (reading.haftara) {
|
|
248
|
-
var _reading$reason;
|
|
249
524
|
memo += 'Haftarah: ' + reading.haftara;
|
|
250
|
-
if (
|
|
525
|
+
if (reading.reason?.haftara) {
|
|
251
526
|
memo += ' | ' + reading.reason.haftara;
|
|
252
527
|
}
|
|
253
528
|
}
|
|
254
529
|
}
|
|
255
|
-
if (reading
|
|
530
|
+
if (reading?.sephardic) {
|
|
256
531
|
memo += '\nHaftarah for Sephardim: ' + reading.sephardic;
|
|
257
532
|
}
|
|
258
533
|
return memo;
|
|
@@ -304,8 +579,7 @@ function appendIsraelAndTracking(url, il, utmSource, utmMedium, utmCampaign) {
|
|
|
304
579
|
u.pathname = '/h/' + path.substring(10);
|
|
305
580
|
} else if (isSedrot) {
|
|
306
581
|
u.pathname = '/s/' + path.substring(8);
|
|
307
|
-
} else {
|
|
308
|
-
// isOmer
|
|
582
|
+
} else { // isOmer
|
|
309
583
|
u.pathname = '/o/' + path.substring(6);
|
|
310
584
|
}
|
|
311
585
|
if (!utmCampaign || !(utmCampaign.startsWith('ical-') || utmCampaign.startsWith('pdf-'))) {
|
|
@@ -345,7 +619,7 @@ function shouldRenderBrief(ev) {
|
|
|
345
619
|
const mask = ev.getFlags();
|
|
346
620
|
if (mask & flags.HEBREW_DATE) {
|
|
347
621
|
const hd = ev.getDate();
|
|
348
|
-
return hd.getDate() === 1 ? false : true;
|
|
622
|
+
return (hd.getDate() === 1) ? false : true;
|
|
349
623
|
} else if (mask & (flags.DAF_YOMI | flags.YERUSHALMI_YOMI)) {
|
|
350
624
|
return true;
|
|
351
625
|
} else if (mask & flags.MINOR_FAST && ev.getDesc().substring(0, 16) === 'Yom Kippur Katan') {
|
|
@@ -359,6 +633,7 @@ function shouldRenderBrief(ev) {
|
|
|
359
633
|
|
|
360
634
|
// eslint-disable-next-line max-len
|
|
361
635
|
const csvHeader = '"Subject","Start Date","Start Time","End Date","End Time","All day event","Description","Show time as","Location"';
|
|
636
|
+
|
|
362
637
|
const CATEGORY = {
|
|
363
638
|
dafyomi: 'Daf Yomi',
|
|
364
639
|
mishnayomi: 'Mishna Yomi',
|
|
@@ -372,7 +647,7 @@ const CATEGORY = {
|
|
|
372
647
|
parashat: 'Torah Reading',
|
|
373
648
|
roshchodesh: 'Jewish Holidays',
|
|
374
649
|
user: 'Personal',
|
|
375
|
-
zmanim: ''
|
|
650
|
+
zmanim: '',
|
|
376
651
|
};
|
|
377
652
|
|
|
378
653
|
/**
|
|
@@ -387,10 +662,12 @@ function eventToCsv(e, options) {
|
|
|
387
662
|
const mon = d.getMonth() + 1;
|
|
388
663
|
const year = String(d.getFullYear()).padStart(4, '0');
|
|
389
664
|
const date = options.euro ? `"${mday}/${mon}/${year}"` : `"${mon}/${mday}/${year}"`;
|
|
665
|
+
|
|
390
666
|
let startTime = '';
|
|
391
667
|
let endTime = '';
|
|
392
668
|
let endDate = '';
|
|
393
669
|
let allDay = '"true"';
|
|
670
|
+
|
|
394
671
|
const timed = Boolean(e.eventTime);
|
|
395
672
|
let subj = shouldRenderBrief(e) ? e.renderBrief(options.locale) : e.render(options.locale);
|
|
396
673
|
if (e.eventTime) {
|
|
@@ -399,31 +676,36 @@ function eventToCsv(e, options) {
|
|
|
399
676
|
endDate = date;
|
|
400
677
|
allDay = '"false"';
|
|
401
678
|
}
|
|
679
|
+
|
|
402
680
|
let loc = 'Jewish Holidays';
|
|
403
681
|
const mask = e.getFlags();
|
|
404
682
|
if (timed && typeof options.location === 'object') {
|
|
405
683
|
const locationName = options.location.getShortName();
|
|
406
684
|
const comma = locationName.indexOf(',');
|
|
407
|
-
loc = comma === -1 ? locationName : locationName.substring(0, comma);
|
|
685
|
+
loc = (comma === -1) ? locationName : locationName.substring(0, comma);
|
|
408
686
|
} else {
|
|
409
687
|
const category = CATEGORY[getEventCategories(e)[0]];
|
|
410
688
|
if (typeof category === 'string') {
|
|
411
689
|
loc = category;
|
|
412
690
|
}
|
|
413
691
|
}
|
|
692
|
+
|
|
414
693
|
subj = subj.replace(/,/g, '').replace(/"/g, '\'\'');
|
|
694
|
+
|
|
415
695
|
if (options.appendHebrewToSubject) {
|
|
416
696
|
const hebrew = e.renderBrief('he');
|
|
417
697
|
if (hebrew) {
|
|
418
698
|
subj += ` / ${hebrew}`;
|
|
419
699
|
}
|
|
420
700
|
}
|
|
701
|
+
|
|
421
702
|
let memo0 = e.memo || getHolidayDescription(e, true);
|
|
422
703
|
if (!memo0 && typeof e.linkedEvent !== 'undefined') {
|
|
423
704
|
memo0 = e.linkedEvent.render(options.locale);
|
|
424
705
|
}
|
|
425
706
|
const memo = memo0.replace(/,/g, ';').replace(/"/g, '\'\'').replace(/\n/g, ' / ');
|
|
426
|
-
|
|
707
|
+
|
|
708
|
+
const showTimeAs = (timed || (mask & flags.CHAG)) ? 4 : 3;
|
|
427
709
|
return `"${subj}",${date},${startTime},${endDate},${endTime},${allDay},"${memo}","${showTimeAs}","${loc}"`;
|
|
428
710
|
}
|
|
429
711
|
|
|
@@ -433,7 +715,7 @@ function eventToCsv(e, options) {
|
|
|
433
715
|
* @return {string}
|
|
434
716
|
*/
|
|
435
717
|
function eventsToCsv(events, options) {
|
|
436
|
-
return [csvHeader].concat(events.map(e => eventToCsv(e, options))).join('\r\n') + '\r\n';
|
|
718
|
+
return [csvHeader].concat(events.map((e) => eventToCsv(e, options))).join('\r\n') + '\r\n';
|
|
437
719
|
}
|
|
438
720
|
|
|
439
721
|
/**
|
|
@@ -452,19 +734,19 @@ function eventIsoDate(ev) {
|
|
|
452
734
|
* @param {boolean} [leyning=true]
|
|
453
735
|
* @return {Object}
|
|
454
736
|
*/
|
|
455
|
-
function eventsToClassicApi(events, options, leyning
|
|
737
|
+
function eventsToClassicApi(events, options, leyning=true) {
|
|
456
738
|
const result = {
|
|
457
739
|
title: getCalendarTitle(events, options),
|
|
458
|
-
date: new Date().toISOString()
|
|
740
|
+
date: new Date().toISOString(),
|
|
459
741
|
};
|
|
460
742
|
result.location = locationToPlainObj(options.location);
|
|
461
743
|
if (events.length) {
|
|
462
744
|
result.range = {
|
|
463
745
|
start: eventIsoDate(events[0]),
|
|
464
|
-
end: eventIsoDate(events[events.length - 1])
|
|
746
|
+
end: eventIsoDate(events[events.length - 1]),
|
|
465
747
|
};
|
|
466
748
|
}
|
|
467
|
-
result.items = events.map(ev => eventToClassicApiObject(ev, options, leyning));
|
|
749
|
+
result.items = events.map((ev) => eventToClassicApiObject(ev, options, leyning));
|
|
468
750
|
return result;
|
|
469
751
|
}
|
|
470
752
|
|
|
@@ -475,12 +757,14 @@ function eventsToClassicApi(events, options, leyning = true) {
|
|
|
475
757
|
* @param {boolean} [leyning=true]
|
|
476
758
|
* @return {Object}
|
|
477
759
|
*/
|
|
478
|
-
function eventToClassicApiObject(ev, options, leyning
|
|
760
|
+
function eventToClassicApiObject(ev, options, leyning=true) {
|
|
479
761
|
const timed = Boolean(ev.eventTime);
|
|
480
762
|
const hd = ev.getDate();
|
|
481
763
|
const dt = hd.greg();
|
|
482
764
|
const tzid = typeof options.location === 'object' ? options.location.getTzid() : 'UTC';
|
|
483
|
-
const date = timed ?
|
|
765
|
+
const date = timed ?
|
|
766
|
+
Zmanim.formatISOWithTimeZone(tzid, ev.eventTime) :
|
|
767
|
+
toISOString(dt);
|
|
484
768
|
const categories = getEventCategories(ev);
|
|
485
769
|
const mask = ev.getFlags();
|
|
486
770
|
let title = shouldRenderBrief(ev) ? ev.renderBrief(options.locale) : ev.render(options.locale);
|
|
@@ -492,7 +776,7 @@ function eventToClassicApiObject(ev, options, leyning = true) {
|
|
|
492
776
|
}
|
|
493
777
|
const result = {
|
|
494
778
|
title: title,
|
|
495
|
-
date: date
|
|
779
|
+
date: date,
|
|
496
780
|
};
|
|
497
781
|
if (!timed) {
|
|
498
782
|
result.hdate = hd.toString();
|
|
@@ -501,7 +785,7 @@ function eventToClassicApiObject(ev, options, leyning = true) {
|
|
|
501
785
|
if (categories.length > 1) {
|
|
502
786
|
result.subcat = categories[1];
|
|
503
787
|
}
|
|
504
|
-
if (categories[0] === 'holiday' && mask & flags.CHAG) {
|
|
788
|
+
if (categories[0] === 'holiday' && (mask & flags.CHAG)) {
|
|
505
789
|
result.yomtov = true;
|
|
506
790
|
}
|
|
507
791
|
if (title != desc) {
|
|
@@ -514,8 +798,10 @@ function eventToClassicApiObject(ev, options, leyning = true) {
|
|
|
514
798
|
if (!candles) {
|
|
515
799
|
if (leyning) {
|
|
516
800
|
const il = options.il;
|
|
517
|
-
const isParsha = mask === flags.PARSHA_HASHAVUA;
|
|
518
|
-
const reading = isParsha ?
|
|
801
|
+
const isParsha = (mask === flags.PARSHA_HASHAVUA);
|
|
802
|
+
const reading = isParsha ?
|
|
803
|
+
getLeyningForParshaHaShavua(ev, il) :
|
|
804
|
+
getLeyningForHoliday(ev, il);
|
|
519
805
|
if (reading) {
|
|
520
806
|
result.leyning = formatLeyningResult(reading);
|
|
521
807
|
const hyear = hd.getFullYear();
|
|
@@ -532,20 +818,21 @@ function eventToClassicApiObject(ev, options, leyning = true) {
|
|
|
532
818
|
const utmSource = options.utmSource || 'js';
|
|
533
819
|
const utmMedium = options.utmMedium || 'api';
|
|
534
820
|
const utmCampaign = options.utmCampaign;
|
|
535
|
-
result.link = appendIsraelAndTracking(url, options.il,
|
|
821
|
+
result.link = appendIsraelAndTracking(url, options.il,
|
|
822
|
+
utmSource, utmMedium, utmCampaign);
|
|
536
823
|
}
|
|
537
824
|
}
|
|
538
825
|
if (mask & flags.OMER_COUNT) {
|
|
539
826
|
result.omer = {
|
|
540
827
|
count: {
|
|
541
828
|
he: ev.getTodayIs('he'),
|
|
542
|
-
en: ev.getTodayIs('en')
|
|
829
|
+
en: ev.getTodayIs('en'),
|
|
543
830
|
},
|
|
544
831
|
sefira: {
|
|
545
832
|
he: ev.sefira('he'),
|
|
546
833
|
translit: ev.sefira('translit'),
|
|
547
|
-
en: ev.sefira('en')
|
|
548
|
-
}
|
|
834
|
+
en: ev.sefira('en'),
|
|
835
|
+
},
|
|
549
836
|
};
|
|
550
837
|
}
|
|
551
838
|
if (mask & flags.MOLAD) {
|
|
@@ -556,18 +843,18 @@ function eventToClassicApiObject(ev, options, leyning = true) {
|
|
|
556
843
|
dow: m.dow,
|
|
557
844
|
hour: m.hour,
|
|
558
845
|
minutes: m.minutes,
|
|
559
|
-
chalakim: m.chalakim
|
|
846
|
+
chalakim: m.chalakim,
|
|
560
847
|
};
|
|
561
848
|
delete result.hebrew;
|
|
562
849
|
}
|
|
563
|
-
if (options.heDateParts && !timed || mask & flags.HEBREW_DATE) {
|
|
850
|
+
if ((options.heDateParts && !timed) || (mask & flags.HEBREW_DATE)) {
|
|
564
851
|
const yy = hd.getFullYear();
|
|
565
852
|
const mm = hd.getMonthName();
|
|
566
853
|
const dd = hd.getDate();
|
|
567
854
|
result.heDateParts = {
|
|
568
855
|
y: gematriya(yy),
|
|
569
856
|
m: Locale.gettext(mm, 'he-x-NoNikud'),
|
|
570
|
-
d: gematriya(dd)
|
|
857
|
+
d: gematriya(dd),
|
|
571
858
|
};
|
|
572
859
|
}
|
|
573
860
|
const memo = ev.memo || holidayDescription[ev.basename()];
|
|
@@ -588,13 +875,12 @@ function eventToClassicApiObject(ev, options, leyning = true) {
|
|
|
588
875
|
* @return {Object}
|
|
589
876
|
*/
|
|
590
877
|
function formatAliyot(result, aliyot) {
|
|
591
|
-
Object.
|
|
592
|
-
const aliyah = aliyot[num];
|
|
878
|
+
for (const [num, aliyah] of Object.entries(aliyot)) {
|
|
593
879
|
if (typeof aliyah !== 'undefined') {
|
|
594
880
|
const k = num == 'M' ? 'maftir' : num;
|
|
595
881
|
result[k] = formatAliyahWithBook(aliyah);
|
|
596
882
|
}
|
|
597
|
-
}
|
|
883
|
+
}
|
|
598
884
|
return result;
|
|
599
885
|
}
|
|
600
886
|
|
|
@@ -617,12 +903,12 @@ function formatLeyningResult(reading) {
|
|
|
617
903
|
formatAliyot(result, reading.fullkriyah);
|
|
618
904
|
}
|
|
619
905
|
if (reading.reason) {
|
|
620
|
-
['7', '8', 'M']
|
|
906
|
+
for (const num of ['7', '8', 'M']) {
|
|
621
907
|
if (reading.reason[num]) {
|
|
622
908
|
const k = num == 'M' ? 'maftir' : num;
|
|
623
909
|
result[k] += ' | ' + reading.reason[num];
|
|
624
910
|
}
|
|
625
|
-
}
|
|
911
|
+
}
|
|
626
912
|
if (reading.reason.haftara) {
|
|
627
913
|
result.haftarah += ' | ' + reading.reason.haftara;
|
|
628
914
|
}
|
|
@@ -661,13 +947,14 @@ function getLinkAndGuid(ev, il, tzid, mainUrl, utmSource, utmMedium) {
|
|
|
661
947
|
}
|
|
662
948
|
return [link, guid];
|
|
663
949
|
}
|
|
950
|
+
|
|
664
951
|
const localeToLg = {
|
|
665
952
|
's': 'en',
|
|
666
953
|
'a': 'en',
|
|
667
954
|
'he-x-NoNikud': 'he',
|
|
668
955
|
'h': 'he',
|
|
669
956
|
'ah': 'en',
|
|
670
|
-
'sh': 'en'
|
|
957
|
+
'sh': 'en',
|
|
671
958
|
};
|
|
672
959
|
|
|
673
960
|
/**
|
|
@@ -680,7 +967,7 @@ function eventsToRss2(events, options) {
|
|
|
680
967
|
weekday: 'long',
|
|
681
968
|
day: '2-digit',
|
|
682
969
|
month: 'long',
|
|
683
|
-
year: 'numeric'
|
|
970
|
+
year: 'numeric',
|
|
684
971
|
});
|
|
685
972
|
const location = options.location;
|
|
686
973
|
const mainUrl = options.mainUrl;
|
|
@@ -691,7 +978,9 @@ function eventsToRss2(events, options) {
|
|
|
691
978
|
const description = options.description || title;
|
|
692
979
|
const utmSource = options.utmSource || 'shabbat1c';
|
|
693
980
|
const utmMedium = options.utmMedium || 'rss';
|
|
694
|
-
const mainUrlEsc = appendIsraelAndTracking(mainUrl,
|
|
981
|
+
const mainUrlEsc = appendIsraelAndTracking(mainUrl,
|
|
982
|
+
location?.getIsrael(),
|
|
983
|
+
utmSource, utmMedium, options.utmCampaign).replace(/&/g, '&');
|
|
695
984
|
const selfUrlEsc = options.selfUrl.replace(/&/g, '&');
|
|
696
985
|
const lang = options.lang || localeToLg[options.locale] || options.locale || 'en-US';
|
|
697
986
|
let str = `<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -705,9 +994,9 @@ function eventsToRss2(events, options) {
|
|
|
705
994
|
<copyright>Copyright (c) ${thisYear} Michael J. Radwin. All rights reserved.</copyright>
|
|
706
995
|
<lastBuildDate>${lastBuildDate}</lastBuildDate>
|
|
707
996
|
`;
|
|
708
|
-
|
|
997
|
+
for (const ev of events) {
|
|
709
998
|
str += eventToRssItem2(ev, options);
|
|
710
|
-
}
|
|
999
|
+
}
|
|
711
1000
|
str += '</channel>\n</rss>\n';
|
|
712
1001
|
return str;
|
|
713
1002
|
}
|
|
@@ -756,11 +1045,7 @@ function eventToRssItem2(ev, options) {
|
|
|
756
1045
|
if (candles) {
|
|
757
1046
|
const colon = subj.indexOf(': ');
|
|
758
1047
|
if (colon != -1) {
|
|
759
|
-
const options = {
|
|
760
|
-
location,
|
|
761
|
-
il,
|
|
762
|
-
locale: Locale.getLocaleName()
|
|
763
|
-
};
|
|
1048
|
+
const options = {location, il, locale: Locale.getLocaleName()};
|
|
764
1049
|
const time = HebrewCalendar.reformatTimeStr(ev.eventTimeStr, 'pm', options);
|
|
765
1050
|
subj = subj.substring(0, colon) + ': ' + time;
|
|
766
1051
|
}
|
|
@@ -770,7 +1055,9 @@ function eventToRssItem2(ev, options) {
|
|
|
770
1055
|
const dayFormat = options.dayFormat;
|
|
771
1056
|
const description0 = memo || dayFormat.format(evDate);
|
|
772
1057
|
const description = description0.indexOf('<') === -1 ? description0 : `<![CDATA[${description0}]]>`;
|
|
773
|
-
const geoTags = cat0 == 'candles' ?
|
|
1058
|
+
const geoTags = (cat0 == 'candles') ?
|
|
1059
|
+
`<geo:lat>${location.getLatitude()}</geo:lat>\n<geo:long>${location.getLongitude()}</geo:long>\n` :
|
|
1060
|
+
'';
|
|
774
1061
|
return `<item>
|
|
775
1062
|
<title>${subj}</title>
|
|
776
1063
|
<link>${link}</link>
|
|
@@ -797,12 +1084,14 @@ function eventToFullCalendar(ev, tzid, il) {
|
|
|
797
1084
|
}
|
|
798
1085
|
const timed = Boolean(ev.eventTime);
|
|
799
1086
|
const title = shouldRenderBrief(ev) ? ev.renderBrief() : ev.render();
|
|
800
|
-
const start = timed ?
|
|
1087
|
+
const start = timed ?
|
|
1088
|
+
Zmanim.formatISOWithTimeZone(tzid, ev.eventTime) :
|
|
1089
|
+
toISOString(ev.getDate().greg());
|
|
801
1090
|
const result = {
|
|
802
1091
|
title,
|
|
803
1092
|
start,
|
|
804
1093
|
allDay: !timed,
|
|
805
|
-
className: classes.join(' ')
|
|
1094
|
+
className: classes.join(' '),
|
|
806
1095
|
};
|
|
807
1096
|
const hebrew = ev.renderBrief('he');
|
|
808
1097
|
if (hebrew) {
|