diff --git a/package-lock.json b/package-lock.json index 10018a9..6587c25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "3.18.0", "license": "BSD-2-Clause", "dependencies": { - "@hebcal/core": "^3.39.2", + "@hebcal/core": "^3.41.0", "@hebcal/leyning": "^4.13.3" }, "devDependencies": { @@ -17,7 +17,7 @@ "@babel/preset-env": "^7.18.2", "@babel/register": "^7.17.7", "@rollup/plugin-babel": "^5.3.1", - "@rollup/plugin-commonjs": "^22.0.0", + "@rollup/plugin-commonjs": "^22.0.1", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.3.0", "ava": "^4.3.0", @@ -1667,9 +1667,9 @@ } }, "node_modules/@hebcal/core": { - "version": "3.39.2", - "resolved": "https://registry.npmjs.org/@hebcal/core/-/core-3.39.2.tgz", - "integrity": "sha512-mD8XwX98wWG/Yjr8YGYZl4BPkOvCKRphcl3axyGwXn5+yd0+ejjSzoSqJBHiNPr31IbY5TsKRqPsDvJwIJkOhg==", + "version": "3.41.0", + "resolved": "https://registry.npmjs.org/@hebcal/core/-/core-3.41.0.tgz", + "integrity": "sha512-gf+n/ARJtjmbDiGFUW6TMVztsfoy1ZdtbYjSglMOcQ+e4N48TkuRJpKl8v0Acl4FyDUZGHHINZ6e5SHBcbMpjg==", "engines": { "node": ">=10.21.0" } @@ -1812,9 +1812,9 @@ } }, "node_modules/@rollup/plugin-commonjs": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.0.tgz", - "integrity": "sha512-Ktvf2j+bAO+30awhbYoCaXpBcyPmJbaEUYClQns/+6SNCYFURbvBiNbWgHITEsIgDDWCDUclWRKEuf8cwZCFoQ==", + "version": "22.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.1.tgz", + "integrity": "sha512-dGfEZvdjDHObBiP5IvwTKMVeq/tBZGMBHZFMdIV1ClMM/YoWS34xrHFGfag9SN2ZtMgNZRFruqvxZQEa70O6nQ==", "dev": true, "dependencies": { "@rollup/pluginutils": "^3.1.0", @@ -7539,9 +7539,9 @@ } }, "@hebcal/core": { - "version": "3.39.2", - "resolved": "https://registry.npmjs.org/@hebcal/core/-/core-3.39.2.tgz", - "integrity": "sha512-mD8XwX98wWG/Yjr8YGYZl4BPkOvCKRphcl3axyGwXn5+yd0+ejjSzoSqJBHiNPr31IbY5TsKRqPsDvJwIJkOhg==" + "version": "3.41.0", + "resolved": "https://registry.npmjs.org/@hebcal/core/-/core-3.41.0.tgz", + "integrity": "sha512-gf+n/ARJtjmbDiGFUW6TMVztsfoy1ZdtbYjSglMOcQ+e4N48TkuRJpKl8v0Acl4FyDUZGHHINZ6e5SHBcbMpjg==" }, "@hebcal/leyning": { "version": "4.13.3", @@ -7644,9 +7644,9 @@ } }, "@rollup/plugin-commonjs": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.0.tgz", - "integrity": "sha512-Ktvf2j+bAO+30awhbYoCaXpBcyPmJbaEUYClQns/+6SNCYFURbvBiNbWgHITEsIgDDWCDUclWRKEuf8cwZCFoQ==", + "version": "22.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.1.tgz", + "integrity": "sha512-dGfEZvdjDHObBiP5IvwTKMVeq/tBZGMBHZFMdIV1ClMM/YoWS34xrHFGfag9SN2ZtMgNZRFruqvxZQEa70O6nQ==", "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", diff --git a/package.json b/package.json index 24e19ff..52dc095 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hebcal/rest-api", - "version": "3.18.0", + "version": "3.19.0", "author": "Michael J. Radwin (https://github.com/mjradwin)", "keywords": [ "hebcal" @@ -21,7 +21,7 @@ "url": "https://github.com/hebcal/hebcal-rest-api/issues" }, "dependencies": { - "@hebcal/core": "^3.39.2", + "@hebcal/core": "^3.41.0", "@hebcal/leyning": "^4.13.3" }, "scripts": { @@ -47,7 +47,7 @@ "@babel/preset-env": "^7.18.2", "@babel/register": "^7.17.7", "@rollup/plugin-babel": "^5.3.1", - "@rollup/plugin-commonjs": "^22.0.0", + "@rollup/plugin-commonjs": "^22.0.1", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.3.0", "ava": "^4.3.0", diff --git a/src/common.spec.js b/src/common.spec.js index edf251c..2bd762d 100644 --- a/src/common.spec.js +++ b/src/common.spec.js @@ -1,7 +1,8 @@ import test from 'ava'; import {getDownloadFilename, getCalendarTitle, makeTorahMemoText, getEventCategories, + getHolidayDescription, appendIsraelAndTracking, locationToPlainObj} from './common'; -import {HebrewCalendar, Location, Event, HDate, flags} from '@hebcal/core'; +import {HebrewCalendar, Location, Event, HDate, flags, HolidayEvent} from '@hebcal/core'; test('getDownloadFilename', (t) => { const location = new Location(38.672294, -90.533239, false, 'America/Chicago', @@ -260,3 +261,22 @@ test('locationToPlainObj-none', (t) => { t.deepEqual(locationToPlainObj(undefined), expected); t.deepEqual(locationToPlainObj({}), expected); }); + +test('getHolidayDescription-firstSentence', (t) => { + const ev = new HolidayEvent(new HDate(14, 'Nisan', 5784), 'Erev Pesach', flags.EREV); + t.is(getHolidayDescription(ev, true), 'Passover, the Feast of Unleavened Bread'); + // eslint-disable-next-line max-len + t.is(getHolidayDescription(ev, false), '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'); +}); + +test('getHolidayDescription-ykk', (t) => { + const ev = new HolidayEvent(new HDate(29, 'Tevet', 5784), 'Yom Kippur Katan', flags.MINOR_FAST); + const s = getHolidayDescription(ev); + t.is(s, 'Minor day of atonement occurring monthly on the day preceeding each Rosh Chodesh'); +}); + +test('getHolidayDescription-notfound', (t) => { + const ev = new Event(new HDate(3, 'Tevet', 5784), 'Foobar', flags.USER_EVENT); + const s = getHolidayDescription(ev); + t.is(s, ''); +}); diff --git a/src/holidays.json b/src/holidays.json index 7c76905..4dd6e07 100644 --- a/src/holidays.json +++ b/src/holidays.json @@ -53,5 +53,6 @@ "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" }