Django jalali leap year is wrong for 1403

Django jalali leap year is wrong for 1403
python
Ethan Jackson

In my django app. Im using django-jalali-date package with version 1.0.1 but 1403 leap year is wrong and it detect 1404 as a leap year.

Answer

So I did found the problem with the method that package uses for detecting the leap year. its using two methods:

  • algorithmic

  • astronomical

in which algorithmic was detecting leap year wrong and astronomical detect it correctly. So in min.js file related to javaScripts of the package i just change one variable which get leapYear method from argument to hard coded "astronomical" and the issue gone away.

Related Articles