msarhan / ummalqura-calendar

Implementation of java.util.Calendar for the Umm Al-Qura calendar system.
MIT License
154 stars 51 forks source link

"1440, 8, 1" and "1440, 9, 1" has same result #19

Closed xiaoweiwu closed 5 years ago

xiaoweiwu commented 5 years ago
  UmmalquraCalendar cal = new UmmalquraCalendar(1440, 8, 1);
    GregorianCalendar calendar = new GregorianCalendar();
    calendar.setTime(cal.getTime());
    int y,m,d;
    y = calendar.get(Calendar.YEAR);
    m = calendar.get(Calendar.MONTH);
    d = calendar.get(Calendar.DAY_OF_MONTH);
    System.out.println(y + "/" + m + "/" + d );

    cal = new UmmalquraCalendar(1440, 9, 1);
    calendar = new GregorianCalendar();
    calendar.setTime(cal.getTime());
    y = calendar.get(Calendar.YEAR);
    m = calendar.get(Calendar.MONTH);
    d = calendar.get(Calendar.DAY_OF_MONTH);
    System.out.println(y + "/" + m + "/" + d );

"1440, 8, 1" and "1440, 9, 1" has same result !

2019/5/4 2019/5/4

another test result: 1440, 6, 27------>2019/4/2 1440, 7, 15------>2019/3/20

GregorianCalendar to UmmalquraCalendar is correct,UmmalquraCalendar to GregorianCalendar sometimes is wrong!

msarhan commented 5 years ago

I've run your sample code and it produces the following output: 2019/4/6 2019/5/4

xiaoweiwu commented 5 years ago

It's very strange, the next day, the program is executed correctly after restart computer..

msarhan commented 5 years ago

So, we can close this issue.