Skip to content

Commit

Permalink
Fix Jerusalem 40-minutes before sunset candle-lighting by using locat…
Browse files Browse the repository at this point in the history
…ion.getShortName()
  • Loading branch information
mjradwin committed Jul 31, 2020
1 parent de01746 commit 5803078
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/core",
"version": "2.2.3",
"version": "2.2.4",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"contributors": [
"Eyal Schachter (https://github.com/Scimonster)",
Expand Down
8 changes: 4 additions & 4 deletions src/hebcal.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ function getCandleLightingMinutes(options) {
if (!options.candlelighting) {
return undefined;
}
const location = options.location || {};
let min = 18;
if (location.il && location.name === 'Jerusalem') {
min = 40;
}
if (typeof options.candleLightingMins === 'number') {
min = Math.abs(options.candleLightingMins);
}
if (options.location && options.location.getIsrael() &&
options.location.getShortName() === 'Jerusalem') {
min = 40;
}
return -1 * min;
}

Expand Down
2 changes: 1 addition & 1 deletion src/hebcal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ test('jerusalem40', (t) => {
year: 2020,
month: 1,
noHolidays: true,
location: Location.lookup('Jerusalem'),
location: new Location(31.76904, 35.21633, true, 'Asia/Jerusalem', 'Jerusalem, Israel', 'IL'),
candlelighting: true,
havdalahMins: 0,
};
Expand Down

0 comments on commit 5803078

Please sign in to comment.