convertdate icon indicating copy to clipboard operation
convertdate copied to clipboard

Hebrew Calendar should include method to return date where Tishrei is 1

Open snoopyjc opened this issue 5 years ago • 7 comments

The first month of civil year is Tishrei, and that is also when the year changes, so please add another method to return that method of month counting (Tishrei=1). This is also consistent with the Jewish calendar in Excel.

Per Wikipedia:

Nowadays, the day most commonly referred to as the "New Year" is 1 Tishrei (Rosh Hashanah, lit. "head of the year"), even though Tishrei is the seventh month of the ecclesiastical year. 1 Tishrei is the civil new year, and the date on which the year number advances. Tishrei marks the end of one agricultural year and the beginning of another,[31] and thus 1 Tishrei is considered the new year for most agriculture-related commandments, including Shmita, Yovel, Maaser Rishon, Maaser Sheni, and Maaser Ani.

snoopyjc avatar Oct 18 '20 04:10 snoopyjc

Should be a relatively straight-forward addition

fitnr avatar Oct 22 '20 15:10 fitnr

Thanks!! Here is the mapping, which is different in Leap years:

    ecclesiastical_to_civil = {7: 1, 8: 2, 9: 3, 10: 4, 11: 5, 12: 6, 1: 7, 2: 8, 3: 9, 4: 10, 5: 11, 6: 12}
    ecclesiastical_leap_to_civil = {7: 1, 8: 2, 9: 3, 10: 4, 11: 5, 12: 6, 13: 7, 1: 8, 2: 9, 3: 10, 4: 11, 5: 12, 6: 13}

snoopyjc avatar Oct 22 '20 17:10 snoopyjc

Took me a second to figure out what this is. I think that the modulo operator (%) is more useful for this kind of thing than hard-coding a dictionary.

fitnr avatar Oct 23 '20 23:10 fitnr

Yes that will work too - just watch the leap years!

-joe Sent from my AT&T iPhone

On Oct 23, 2020, at 7:36 PM, Neil Freeman [email protected] wrote:

 Took me a second to figure out what this is. I think that the modulo operator (%) is more useful for this kind of thing than hard-coding a dictionary.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

snoopyjc avatar Oct 23 '20 23:10 snoopyjc

While this is easy to add mathematically, I'm going to spend a little more time figuring out the best way to handle it in a backward-compatible way in the existing function calls. I'll try to get it in the next release.

fitnr avatar Nov 07 '20 14:11 fitnr

How about: year, month, day = hebrew.from_gregorian(*ymd, civil=True)

snoopyjc avatar Nov 07 '20 15:11 snoopyjc

Yeah, that's probably the most straightforward way. There are several supporting functions, so the cleanest way to incorporate will probably involve some refactoring.

In the meantime, the hebrew.to_civil function added v2.3.0 should be useful

fitnr avatar Nov 07 '20 22:11 fitnr