hebcal/hebcal-es6

Candle lighting

Closed this issue · 1 comments

This is more of a feature request. Is it possible to add the ability to get candle lighting for a HDate?

Yes, you want to use the Zmanim class for this.

https://github.com/hebcal/hebcal-es6/blob/main/README.md#Zmanim

Here's an example for Providence, Rhode Island, using Friday's date and 18 minutes before sunset:

const {Zmanim} = require('@hebcal/core');

const latitude = 41.822232;
const longitude = -71.448292;
const friday = new Date(2023, 8, 8);
const zmanim = new Zmanim(friday, latitude, longitude);
const candleLighting = zmanim.sunsetOffset(-18, true);
console.log(candleLighting);
const timeStr = Zmanim.formatISOWithTimeZone('America/New_York', candleLighting);
console.log(timeStr);

Does this help?