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

I don't get how tachanun works #38

Closed
orelzion opened this issue May 8, 2017 · 2 comments
Closed

I don't get how tachanun works #38

orelzion opened this issue May 8, 2017 · 2 comments

Comments

@orelzion
Copy link

orelzion commented May 8, 2017

Hi

A great library, thanks! I didn't understand how Tachanun works, it seems that it returns different integers than described, or I'm calling it wrong

When I'm trying to get Tachanun for 4th of Tishri, it returns 7, the same is with 8th, but 9th returns 0. Also, Yom Haatzmaut returns 3

Can you please explain how to use this function? Thanks

@Scimonster
Copy link
Contributor

The function returns an integer that functions as a bitmask. To understand the return values, you can look at them in binary (3 bits):

0 - 000 - not all congregations say tachanun, no Shacharit, no Mincha [i.e no tachanun, according to everyone]
1 - 001 - not all congregations say tachanun, no Shacharit, yes Mincha [I don't think this is possible]
2 - 010 - not all congregations say tachanun, yes Shacharit, no Mincha [Some say tachanun at Shacharit]
3 - 011 - not all congregations say tachanun, yes Shacharit, yes Mincha [Some congregations say tachanun]
4 - 100 - all congregations say tachanun, no Shacharit, no Mincha [impossible return value]
5 - 101 - all congregations say tachanun, no Shacharit, yes Mincha [also impossible, same reason as 1]
6 - 110 - all congregations say tachanun, yes Shacharit, no Mincha [Tachanun at Shacharit, according to everyone]
7 - 111 - all congregations say tachanun, yes Shacharit, yes Mincha [Tachanun at Shacharit and Mincha, according to everyone]

You can extract values using bitwise AND (&):

today.tachanun() & 1 // truthy if Tachanun is said at Mincha, falsy otherwise
today.tachanun() & 2 // truthy if Tachanun is said at Shacharit, falsy otherwise
today.tachanun() & 4 // truthy if Tachanun is said by all congregations at the tefilot indicated by the other two bits, falsy otherwise

Hope this helps.

@Scimonster
Copy link
Contributor

Added a tachanun_uf() function in v2.2.4.

new Hebcal.HDate('1 Tishrei').tachanun_uf() // { shacharit: false, mincha: false, all_congs: false }
new Hebcal.HDate('25 Tishrei').tachanun_uf() // { shacharit: true, mincha: true, all_congs: false }
new Hebcal.HDate('6 Cheshvan').tachanun_uf() // { shacharit: true, mincha: true, all_congs: true }
new Hebcal.HDate().onOrAfter(5).tachanun_uf() // Friday: { shacharit: true, mincha: false, all_congs: true }
new Hebcal.HDate().onOrAfter(6).tachanun_uf() // Shabbat: { shacharit: false, mincha: true, all_congs: true }

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

2 participants