diff --git a/package-lock.json b/package-lock.json index 746a9f5..8a060bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "@hebcal/rest-api", - "version": "3.19.2", + "version": "3.19.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@hebcal/rest-api", - "version": "3.19.2", + "version": "3.19.3", "license": "BSD-2-Clause", "dependencies": { - "@hebcal/core": "^3.42.0", - "@hebcal/leyning": "^4.15.1" + "@hebcal/core": "^3.42.1", + "@hebcal/leyning": "^4.17.0" }, "devDependencies": { "@babel/core": "^7.18.10", @@ -26,7 +26,7 @@ "eslint-config-google": "^0.14.0", "jsdoc": "^3.6.11", "jsdoc-to-markdown": "^7.1.1", - "rollup": "^2.77.2", + "rollup": "^2.77.3", "rollup-plugin-terser": "^7.0.2" } }, @@ -1680,19 +1680,19 @@ } }, "node_modules/@hebcal/core": { - "version": "3.42.0", - "resolved": "https://registry.npmjs.org/@hebcal/core/-/core-3.42.0.tgz", - "integrity": "sha512-XkGg3rrAf5pFaGZsEz7so0ZOn1j9rP0Aa0OSA6WGhn/J55xy8vKE/QAAwSb3+sJc/8IH/4/00aER1epdn4/w9g==", + "version": "3.42.1", + "resolved": "https://registry.npmjs.org/@hebcal/core/-/core-3.42.1.tgz", + "integrity": "sha512-f26fLbilLDifcTPa3U9aKnoSj0aUx5OqPriJaUKEjlUz1SiN6DM2e1IRXyqJ/E20u+2GBesemXQS4/Xzxz+tpw==", "engines": { "node": ">=10.21.0" } }, "node_modules/@hebcal/leyning": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/@hebcal/leyning/-/leyning-4.15.1.tgz", - "integrity": "sha512-ffey9mOjzBvVfNhdhAMyY+/5HNM39xGw1BD80GXdGpTUBWoj1XS26CSx2tgjnN0eFY4cdrpTlsB2eNhtdKwMTg==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@hebcal/leyning/-/leyning-4.17.0.tgz", + "integrity": "sha512-dbqevYNcUgw2AO8QX1+sq8FJEb6TlCceGpscY0284xbvDpPUKoskzgktoLUExU6vMw8VZFQkh590zxQulm9CZA==", "dependencies": { - "@hebcal/core": "^3.42.0" + "@hebcal/core": "^3.42.1" }, "bin": { "leyning-csv": "bin/leyning-csv" @@ -5618,9 +5618,9 @@ } }, "node_modules/rollup": { - "version": "2.77.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.77.2.tgz", - "integrity": "sha512-m/4YzYgLcpMQbxX3NmAqDvwLATZzxt8bIegO78FZLl+lAgKJBd1DRAOeEiZcKOIOPjxE6ewHWHNgGEalFXuz1g==", + "version": "2.77.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.77.3.tgz", + "integrity": "sha512-/qxNTG7FbmefJWoeeYJFbHehJ2HNWnjkAFRKzWN/45eNBBF/r8lo992CwcJXEzyVxs5FmfId+vTSTQDb+bxA+g==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -7703,16 +7703,16 @@ } }, "@hebcal/core": { - "version": "3.42.0", - "resolved": "https://registry.npmjs.org/@hebcal/core/-/core-3.42.0.tgz", - "integrity": "sha512-XkGg3rrAf5pFaGZsEz7so0ZOn1j9rP0Aa0OSA6WGhn/J55xy8vKE/QAAwSb3+sJc/8IH/4/00aER1epdn4/w9g==" + "version": "3.42.1", + "resolved": "https://registry.npmjs.org/@hebcal/core/-/core-3.42.1.tgz", + "integrity": "sha512-f26fLbilLDifcTPa3U9aKnoSj0aUx5OqPriJaUKEjlUz1SiN6DM2e1IRXyqJ/E20u+2GBesemXQS4/Xzxz+tpw==" }, "@hebcal/leyning": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/@hebcal/leyning/-/leyning-4.15.1.tgz", - "integrity": "sha512-ffey9mOjzBvVfNhdhAMyY+/5HNM39xGw1BD80GXdGpTUBWoj1XS26CSx2tgjnN0eFY4cdrpTlsB2eNhtdKwMTg==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@hebcal/leyning/-/leyning-4.17.0.tgz", + "integrity": "sha512-dbqevYNcUgw2AO8QX1+sq8FJEb6TlCceGpscY0284xbvDpPUKoskzgktoLUExU6vMw8VZFQkh590zxQulm9CZA==", "requires": { - "@hebcal/core": "^3.42.0" + "@hebcal/core": "^3.42.1" } }, "@humanwhocodes/config-array": { @@ -10623,9 +10623,9 @@ } }, "rollup": { - "version": "2.77.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.77.2.tgz", - "integrity": "sha512-m/4YzYgLcpMQbxX3NmAqDvwLATZzxt8bIegO78FZLl+lAgKJBd1DRAOeEiZcKOIOPjxE6ewHWHNgGEalFXuz1g==", + "version": "2.77.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.77.3.tgz", + "integrity": "sha512-/qxNTG7FbmefJWoeeYJFbHehJ2HNWnjkAFRKzWN/45eNBBF/r8lo992CwcJXEzyVxs5FmfId+vTSTQDb+bxA+g==", "dev": true, "requires": { "fsevents": "~2.3.2" diff --git a/package.json b/package.json index 9a63e3a..390628f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hebcal/rest-api", - "version": "3.19.3", + "version": "3.19.4", "author": "Michael J. Radwin (https://github.com/mjradwin)", "keywords": [ "hebcal" @@ -21,8 +21,8 @@ "url": "https://github.com/hebcal/hebcal-rest-api/issues" }, "dependencies": { - "@hebcal/core": "^3.42.0", - "@hebcal/leyning": "^4.15.1" + "@hebcal/core": "^3.42.1", + "@hebcal/leyning": "^4.17.0" }, "scripts": { "build": "rollup -c", @@ -56,7 +56,7 @@ "eslint-config-google": "^0.14.0", "jsdoc": "^3.6.11", "jsdoc-to-markdown": "^7.1.1", - "rollup": "^2.77.2", + "rollup": "^2.77.3", "rollup-plugin-terser": "^7.0.2" } } diff --git a/src/classic-rest-api.js b/src/classic-rest-api.js index 18c4705..2ef972f 100644 --- a/src/classic-rest-api.js +++ b/src/classic-rest-api.js @@ -1,4 +1,4 @@ -import {Locale, flags, HebrewCalendar, Zmanim} from '@hebcal/core'; +import {Locale, flags, HebrewCalendar, Zmanim, gematriya} from '@hebcal/core'; import * as leyn from '@hebcal/leyning'; import { getCalendarTitle, @@ -97,7 +97,7 @@ export function eventToClassicApiObject(ev, options, leyning=true) { if (reading) { result.leyning = formatLeyningResult(reading); const hyear = hd.getFullYear(); - if (isParsha && !il && hyear >= 5745 && hyear <= 5830) { + if (isParsha && !il && hyear >= 5745) { const triReading = leyn.getTriennialForParshaHaShavua(ev); if (triReading) { result.leyning.triennial = formatAliyot({}, triReading); @@ -127,6 +127,16 @@ export function eventToClassicApiObject(ev, options, leyning=true) { }, }; } + if (mask & flags.HEBREW_DATE) { + const yy = hd.getFullYear(); + const mm = hd.getMonthName(); + const dd = hd.getDate(); + result.heDateParts = { + y: gematriya(yy), + m: Locale.gettext(mm, 'he-x-NoNikud'), + d: gematriya(dd), + }; + } const memo = ev.memo || holidayDescription[ev.basename()]; if (memo) { result.memo = memo; diff --git a/src/classic-rest-api.spec.js b/src/classic-rest-api.spec.js index b5f307e..5deac16 100644 --- a/src/classic-rest-api.spec.js +++ b/src/classic-rest-api.spec.js @@ -429,6 +429,11 @@ test('hebdate', (t) => { category: 'hebdate', title_orig: '24 Kislev 5756', hebrew: 'כ״ד כסלו', + heDateParts: { + d: 'כ״ד', + m: 'כסלו', + y: 'תשנ״ו', + }, }; t.deepEqual(obj, expected); }); @@ -484,6 +489,11 @@ test('location-zip', (t) => { category: 'hebdate', title_orig: '1 Adar II 5782', hebrew: 'א׳ אדר ב׳', + heDateParts: { + d: 'א׳', + m: 'אדר ב׳', + y: 'תשפ״ב', + }, }, ], };