-
Notifications
You must be signed in to change notification settings - Fork 6
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
Get rosh Hashanah based on gregorian calendar #23
Comments
I'm not sure if it's documented, but you can use this static function to get the date of Rosh Hashana for this Jewish year. https://github.com/zmanim/zman/blob/main/src/Moadim/Holidays.php#L46 |
so I need to check if today is after rosh hashona |
Right now, it could be accomplished via something like: Zman::firstDayOfRoshHashana(
Zman::parse('April 11, 2017')->jewishYear
);
// or
Zman::firstDayOfRoshHashana(
Zman::now()->next('year')->jewishYear
); which honestly seems simple enough to me to be getting on with.
This is the hardest part of what you are proposing. "After rosh hashona" is ambiguous, as you will always be after the last rosh hashana and before the next rosh hashana. Plus, since there are different ways to count "this year" i.e. tishrei vs nissan etc, I don't think we should really guess which one you meant. It's for that reason that you need to explicitly specify the year for the rosh hashana you want. I see a few ways this could be made a bit easier though:
|
You don't need to say 5XXX vs 2XXX. You can get the Rosh Hashana for the current Gregorian year as follows: Get the current Jewish year (e.g. 5781) and get the current Gregorian year (e.g. 2021). If the difference is 3760, then we know that it is before Rosh Hashana and if the difference is 3761 then we know that it is after Rosh Hashana. If it's before then we get the first day of Rosh Hashana for the current Jewish year plus one. If it's after then we just get the first day of Rosh Hashana for the current year |
please let me know if im wrong
but there is no easy way to get this years Rosh hashana based on the gregorian calendar
The text was updated successfully, but these errors were encountered: