hebcal / hebcal-js

⛔️ DEPRECATED - a perpetual Jewish Calendar (JavaScript)
GNU General Public License v3.0
123 stars 40 forks source link

setCity() doesn't work #50

Closed icarpis closed 5 years ago

icarpis commented 5 years ago

I'm trying to get the Jerusalem candle lighting time for the coming Shabat by the following code snippet:

var hebDate = new Hebcal.HDate();
hebDate.setCity('Jerusalem');
var d = hebDate.after(5).candleLighting();

For some reason I'm getting the same time no matter if I call to setCity or not.

mjradwin commented 5 years ago

I don't think you can call setCity on an HDate object.

According to the README, you should do:

var year = new Hebcal();

year.setCity('Jerusalem');

-- Sent from my mobile device

On Tue, Aug 28, 2018, 9:30 AM Itay Carpis notifications@github.com wrote:

I'm trying to get the Jerusalem candle lighting time for the coming Shabat by the following code snippet:

var hebDate = new Hebcal.HDate(); hebDate.setCity('Jerusalem'); var d = hebDate.after(5).candleLighting();

For some reason I'm getting the same time no matter if I call to setCity or not.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hebcal/hebcal-js/issues/50, or mute the thread https://github.com/notifications/unsubscribe-auth/ADmC1d3QbvqnkOyAg8wsUW72AMuAp3_Dks5uVXAVgaJpZM4WP-Q0 .

icarpis commented 5 years ago

Thank you @mjradwin, but I still get unreasonable times.

mjradwin commented 5 years ago

@Scimonster can you take a look?

Scimonster commented 5 years ago

It seems that the call to after() made it lose the location data. Fixed now.

(You can set the location directly on an HDate BTW.)