Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Elyahu41 opened this issue Jan 4, 2023 · 3 comments

Comments

@Elyahu41
Copy link

Elyahu41 commented Jan 4, 2023

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!

@Elyahu41
Copy link
Author

Elyahu41 commented Jan 4, 2023

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.

@Elyahu41
Copy link
Author

Elyahu41 commented Jan 4, 2023

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...

@Elyahu41
Copy link
Author

Elyahu41 commented Jan 4, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant