Skip to content

Conversation

@Elyahu41
Copy link
Contributor

@Elyahu41 Elyahu41 commented Mar 9, 2021

Needs updating.

}
if (day == 14) {
return EREV_PESACH;
return EREV_PESACH;//TODO add Fast of firstborns with Erev Pesach
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into a problem here with only being able to return one result. I'm not sure what you want to do with the future of this method, so I just left a TODO comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does't this mean that if it's the 13th of the month and it's friday that it will return that today is taanit bechorot? don't we push up taanit bechorot to thursday the 12th?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elijulian yes, it will start from Thursday night through Friday. This how the getYomTovIndex method works. It looks at the day of the current date, not the night before it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in essence the 12th is Erev Ta'anit Bechorot

Copy link
Owner

@KosherJava KosherJava Mar 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Elyahu41
I would argue that the day (either the 12th or 14th) is never called the "day of Taanis Bechoros", rather there is a minhag (brought down lehalacha, but still a minhag)to fast on erev pesach and that fast that is usually on Erev Pesach, but sometimes is on a different date. I would not have the YT index change for this. I was considering adding the day to isTaanis(), but that can honestly be confusing as well since it is not a regular taanis. As per the Mishna Berura on 470:2 no. 7, the taanis is only a minhag. In no. 2 the Mishna Berura mentions that it is a taanis yachid and that it is preferable to avoid saying aneinu in chazaras hashatz (if there are 10 bechorim fasting we should avoid having a bechor as the shaliach tzibur) since we do not mention a taanis in Nissan publicly. Vayechal is not recited (mentioned in 566:2 in Biur Halacha Veyesh).
In short, my feeling is that this does not fit into the API at this point the way you coded it. Adding an isTaanisBechorim() method is a possibility, but I am not 100% sure about that. The way I would code it is below.

/**
 * Return true if the day is Taanis Bechorim (on erev Pesach). It will return true for the 14th of Nissan if it is not
 * on Shabbos, or if the 12th of Nissan occurs on a Thursday
 * 
 * @return true if today is the fast of Bechorim
 */
public boolean isTaanisBechorim() {
    final int day = getJewishDayOfMonth();
    final int dayOfWeek = getDayOfWeek();
    // on 14 Nisan unless that is Shabbos where the fast is moved back to Thursday
    return getJewishMonth() == NISSAN && ((day == 14 && dayOfWeek != Calendar.SATURDAY) ||
            (day == 12 && dayOfWeek == Calendar.THURSDAY ));
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elijulian I double checked, and you were right. I was assuming that the fast was on Friday. My bad. Good thing @KosherJava is here to keep us in check lol.

@Elyahu41
Copy link
Contributor Author

Elyahu41 commented Mar 9, 2021

I know this implementation isn't perfect, but I figured that it's a start.

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

Successfully merging this pull request may close these issues.

3 participants