amirmehdizadeh / JalaliCalendar

Apache License 2.0
84 stars 46 forks source link

2025 Leap Year Issue #4

Open mbeaty opened 10 years ago

mbeaty commented 10 years ago

I added this test. It should pass, but doesn't:

Assert.assertEquals( JalaliCalendar.gregorianToJalali(new JalaliCalendar.YearMonthDate(2025, 2, 20)).toString(), "1404/0/1");

amirmehdizadeh commented 10 years ago

Thank you for reporting this issue, i search and found this http://www.fourmilab.ch/documents/calendar/, you can convert date with this and see the description about 1925. i try to research about this issue and reply to you later.

mbeaty commented 10 years ago

You're right. I'm seeing discrepancies between different online converters. I was comparing your implementation to these (both implement the exact same javascript algorithm):

http://www.afghaneic.org/converter.php http://www.iranchamber.com/calendar/converter/iranian_calendar_converter.php

These produce different results from yours at 2025, 2058, 2091...etc (33 year cycles). But, yours match the fourmilab converter (Modern Persian Calendar) and other similar converters I found online. If you come up with a good explanation, I would be interested in hearing. Thank you.