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

Begin JewishCalendar day At Sunset or Nightfall #139

Open
ghost opened this issue Aug 22, 2019 · 4 comments
Open

Begin JewishCalendar day At Sunset or Nightfall #139

ghost opened this issue Aug 22, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 22, 2019

Being a Jewish calendar I would expect it to begin at nightfall. However, from looking at the code it seems that it always uses the regular Calendar date, which begins at midnight. This can result in incorrect results.

Consider the following:

JewishCalendar jcal = new JewishCalendar();
if (jcal.isAssurBemelacha())
    System.out.print("Please don't use on Shabbat or Jewish Holidays");

This would consider even after nightfall on Saturday as if it is Shabbat (and therefore isAssurBemelacha() would evaluate to true), while it should not consider it to be Shabbat (and isAssurBemelacha() should evaluate to false).

@zachweix
Copy link

You are indeed correct that it should be based on the user's location, but you can use the function at https://github.com/KosherJava/zmanim/blob/master/src/net/sourceforge/zmanim/ZmanimCalendar.java#L672 to get what you are looking for

@KosherJava
Copy link
Owner

@plonibarploni The current design of the library has no concept of time. Adding it would seriously complicate things. As @zachweix pointed out, there is support for what you are looking for in the Zmanim portion of the API that is very time aware. While I will leave this open, I do not see a resolution to this item in the near future.

@ghost
Copy link
Author

ghost commented Aug 26, 2019

@KosherJava While JewishDate states very prominently that it has no concept of time, JewishCalendar does not. Regardless, it seems to be very misleading to include this function isAssurBemelacha() in a class that has no concept of time, being as it very specifically requires time to be taken into consideration. At the very least, a note should be added to the Javadoc of the function to state that it doesn't factor in the time.

@KosherJava KosherJava changed the title JewishCalendar day beginning? Begin JewishCalendar day At Sunset or Nightfall Nov 29, 2022
@CompuGenius-Programs
Copy link

I created a JewishDate() constructor that takes sunset into account, and the dev replied with some ideas of how to properly implement it.
See #193

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

3 participants