KosherJava/zmanim

JewishCalendar computes some dates wrong?

Closed this issue · 5 comments

nafg commented

To reproduce:

new JewishCalendar(new GregorianCalendar(1582, 9, 14))

Expected: 18 Tishrei 5343 (via Rosetta Calendar)
Got: 28 Tishrei 5343

@nafg from the Wikipedia Gregorian calendar entry

When the new calendar was put in use, the error accumulated in the 13 centuries since the Council of Nicaea was corrected by a deletion of 10 days. The Julian calendar day Thursday, 4 October 1582 was followed by the first day of the Gregorian calendar, Friday, 15 October 1582

I think that this explains the discrepancy that you mentioned, and is more accurate than a raw calculation done by other libraries. Do you agree with this?

https://www.hebcal.com/converter/?gd=15&gm=10&gy=1582&g2h=1
Fri, 15 October 1582 = 19th of Tishrei, 5343

@nafg essentially, 1582-10-14 is not a valid Gregorian date, so conversion using a malformed object shouldn't expect to yield a sensible result.

@nafg do you see any reason to keep this open given that the date predates the Gregorian calendar?

Closing based on comments above.