fitnr / convertdate

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

julian.leap() always truthy for BC years #43

Closed xayhewalo closed 3 years ago

xayhewalo commented 3 years ago

Apologizes for the bombardment of issues, but i don't think julian.leap is doing what it's supposed to. The readme says the Julian calendar is proleptic before 4 CE, but the leap method always returns 3 for negative years, implying all BC years are leap years which I don't think is the intention.

I'm guessing the intended leap year function is:

def leap(year):
    return year % 4 == 0

However, julian.leap is used in julian.monthlength which is used in julian.legal_date which is used in julian.to_jd, so changing this leap year method could effect conversions. So does the leap method serve some other purpose I'm not aware?

fitnr commented 3 years ago

You're correct. I've added a bugfix for the next version.