Skip to content

Commit

Permalink
Fix leyning parameter on JSON APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Nov 19, 2024
1 parent 541a4cc commit fa14861
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"license": "BSD-2-Clause",
"devDependencies": {
"@eslint/js": "^9.14.0",
"@eslint/js": "^9.15.0",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-terser": "^0.4.4",
"bootstrap5-autocomplete": "^1.1.33",
"csv-parse": "^5.5.6",
"eslint": "^9.14.0",
"eslint-plugin-n": "^17.13.1",
"eslint": "^9.15.0",
"eslint-plugin-n": "^17.13.2",
"globals": "^15.12.0",
"rollup": "^4.25.0"
"rollup": "^4.27.3"
},
"dependencies": {
"@hebcal/core": "^5.8.2",
Expand Down
2 changes: 1 addition & 1 deletion src/hebcal.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ function renderJson(ctx) {
if (q.hdp === '1') {
options.heDateParts = true;
}
let obj = myEventsToClassicApi(events, options, leyningOff);
let obj = myEventsToClassicApi(events, options, !leyningOff);
const cb = empty(q.callback) ? false : q.callback.replace(/[^\w\.]/g, '');
if (cb) {
obj = cb + '(' + JSON.stringify(obj) + ')\n';
Expand Down
6 changes: 3 additions & 3 deletions src/myEventsToClassicApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {readJSON} from './readJSON.js';

export const pkg = readJSON('../package.json');

export function myEventsToClassicApi(events, options, leyningOff) {
export function myEventsToClassicApi(events, options, leyning) {
const obj = eventsToClassicApiHeader(events, options);
if (typeof obj.version === 'string') {
obj.version += '-' + pkg.version;
}
obj.items = events.map((ev) => {
const apiObj = eventToClassicApiObject(ev, options, !leyningOff);
if (!leyningOff &&
const apiObj = eventToClassicApiObject(ev, options, leyning);
if (leyning &&
(ev.getFlags() & flags.PARSHA_HASHAVUA) &&
ev.getDate().getFullYear() >= 5745) {
const triReading = getTriennialForParshaHaShavua(ev, options.il);
Expand Down

0 comments on commit fa14861

Please sign in to comment.