# [PATCH] Fix cal_from_jd() for Jewish calendar

- Thread: https://externals.io/message/57358
- Original archive: https://news-web.php.net/php.internals/57358
- Started by Eitan Mosenkis on 2012-01-13T16:41:04+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #57358 — Eitan Mosenkis — 2012-01-13T16:41:04+00:00

URL: https://externals.io/message/57358#57358

This didn't seem to get much notice the first time I sent it, so as
per the suggestion at (http://php.net/svn-php.php), I'm resending it.
It would be great if someone could commit it to the source tree so
this bug can be closed. Please let me know if I need to do something
differently or if you have questions or objections.

This is a patch to fix the main issue in bug #54254 (the other issue
mentioned would require some structural changes in how calendars are
handled and is more of a feature request), cal_from_jd(CAL_JEWISH)
returns month=6 for Adar when there is only one Adar, (it should
return 7, since if there is only one Adar it's AdarII). This will
clear up an issue where cal_from_jd() returns a month that
cal_days_in_month() reports to have 0 days due to an inconsistency in
how dates are converted to and from the Jewish calendar. This patch
should create the correct behavior.

Thanks,
Eitan

https://bugs.php.net/bug.php?id=54254
