BehindTheMath/KosherZmanim

Can we please have an actual example of using this project not through JSON?!

Opened this issue · 3 comments

It may just be me, but I am a beginner to Javascripts quirks. I have to research everything I do before I can implement it. The beauty of this project is that it is exactly like the KosherJava version with a few differences because of the language. However, as a newcomer, this project NEEDS better documentation. I just have a big problem with the fact that the documentation doesn't even show how to display the luxon DateTime objects returned by the API.

For example look at this piece of code:

var zmanimCalendar = new ComplexZmanimCalendar(new GeoLocation( "Jerusalem", 31.76904, 35.21633, 792, "Asia/Jerusalem" )); console.log(zmanimCalendar.getAlos72Zmanis().toJSDate().toLocaleTimeString());
This is originally what I used to display the zmanim. However, now I realize that this only works in my timezone/locality. If I change the location to New York, the time shown gets skewed 7 hours. Now I need to figure out how to use luxon to display the time in THAT timezone.

Again, I have no complaints against the work you put into the project, but it is not beginner friendly AT ALL. This is not the first time I had to reimplement a feature using this project because I was not informed of some quirks of javascript.

So can you please post some more examples in the readme using this project? Show an example like my where you want to display the time in any DateTime object around the world. Show how to use convert the time to show seconds and to not show seconds.

I know this is research we as beginners can do ourservles, but javascript is EVIL with timezones! I would love it if you could show how to properly use your package with luxon by adding examples and ideas.

Thank you and kol tuv!

Also, I would appreciate any help as to my problem listed above. I still have not figured it out.

The time for Alos in Jerusalem using the getAlos72Zmanis method gives me 5:33:06AM in KosherJava. But in the KosherZmanim port it gives me around 3:33AM. It's 2 hours off for some reason... I am using the .toJSDate().toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }). I would appreciate any help.

I just noticed that .offset is returning 0 on the DateTime object returned by my zmanimCalendar Object.... Even though I provided Asia/Jerusalem as the timezoneID...

If I call setZone manually on each get method on the ComplexZmanimCalendar, the timezone is forced to apply to the DateTime object. But I passed the timezoneID into the constructor... Why isn't it applying?