You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Begin JewishCalendar day At Sunset or Nightfall #139
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).
@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.
Activity
zachweix commentedon Aug 22, 2019
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 commentedon Aug 22, 2019
@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.
[-]JewishCalendar day beginning?[/-][+]Begin JewishCalendar day At Sunset or Nightfall[/+]ZevyaDev commentedon Dec 4, 2022
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