fitnr / convertdate

Utils for converting between date formats and calculating holidays
MIT License
47 stars 24 forks source link

Fixing Baha'i Calendar #14

Closed bchurchill closed 5 years ago

bchurchill commented 5 years ago

In 2014 the governing authority for the Baha'is, the Universal House of Justice, decided to implement previously unspecified details for the Baha'i (Badi) calendar. As a result, the date for Naw Ruz changed, and is now based on the moment of the Spring equinox in combination with the time of sunset in Tehran. This PR implements:

For reference, the following specifications were used:

https://www.bahai.org/library/authoritative-texts/the-universal-house-of-justice/messages/20140710_001/1#174438046 https://www.bahai.us/events/holy-days/

fitnr commented 5 years ago

This looks fairly good. I'll need a little time to review. My first inclination is to generalize the solstice-finding function and move it out of bahai.py

bchurchill commented 5 years ago

Thanks! Yeah, take your time. The solstice finding function actually belongs to a dependency (pymeeus). The only reason bahai.py has some special logic for that is because in the Baha'i calendar, the date of Naw Ruz can be a day before/after the spring equinox depending on when sunset is in Tehran.

fitnr commented 5 years ago

I've collapsed your changes into one commit and merged the results. This is now published in v2.2.0