dhlab-basel / JDNConvertibleCalendar

Different calendars can be freely converted using Julian Day Number
GNU Affero General Public License v3.0
4 stars 3 forks source link

Add support for Islamic calendar #10

Closed tobiasschweizer closed 5 years ago

tobiasschweizer commented 5 years ago

Implements support for the Islamic calendar.

closes #5

tobiasschweizer commented 5 years ago

@gautschr I fixed the compile problem by using let. No there seems to be a problem related to rounding:


  1) JDC to Islamic
       convert the JDC 2458093.5 to the Islamic Calendar date 17-03-1439:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 16 instead of 17
      + expected - actual

      -16
      +17

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:479:9)
      at processImmediate (internal/timers.js:443:21)

  2) JDC to Islamic
       convert the JDC 2458093.6 to the Islamic Calendar date 17-03-1439:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 16 instead of 17
      + expected - actual

      -16
      +17

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:484:9)
      at processImmediate (internal/timers.js:443:21)

  3) JDC to Islamic
       convert the JDC 2448481.5 to the Islamic Calendar date 02-02-1412:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 1 instead of 2
      + expected - actual

      -1
      +2

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:494:9)
      at processImmediate (internal/timers.js:443:21)

  4) JDC to Islamic
       convert the JDC 1948439.5 to the Islamic Calendar date 01-01-0001:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: year is 0 instead of 1
      + expected - actual

      -0
      +1

      at checkCalendarDate (dist/test/UnitTests.js:33:12)
      at Context.<anonymous> (dist/test/UnitTests.js:504:9)
      at processImmediate (internal/timers.js:443:21)

  5) JDC to Islamic
       convert the JDC 2058044.5 to the Islamic Calendar date 18-04-0310:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 17 instead of 18
      + expected - actual

      -17
      +18

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:519:9)
      at processImmediate (internal/timers.js:443:21)

  6) JDC to Islamic
       convert the JDC 2094600.5 to the Islamic Calendar date 15-06-0413:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 14 instead of 15
      + expected - actual

      -14
      +15

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:524:9)
      at processImmediate (internal/timers.js:443:21)

  7) JDC to Islamic
       convert the JDC 2204108.5 to the Islamic Calendar date 24-06-0722:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 23 instead of 24
      + expected - actual

      -23
      +24

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:539:9)
      at processImmediate (internal/timers.js:443:21)

  8) JDC to Islamic
       convert the JDC 2423373.5 to the Islamic Calendar date 25-03-1341:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 24 instead of 25
      + expected - actual

      -24
      +25

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:569:9)
      at processImmediate (internal/timers.js:443:21)

  9) JDC to Islamic
       convert the JDC 2451481.5 to the Islamic Calendar date 20-07-1420:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 19 instead of 20
      + expected - actual

      -19
      +20

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:574:9)
      at processImmediate (internal/timers.js:443:21)

  10) JDN to Islamic
       convert the JDN 2458094 to the Islamic Calendar date 17-03-1439:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 16 instead of 17
      + expected - actual

      -16
      +17

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:581:9)
      at processImmediate (internal/timers.js:443:21)

  11) JDN to Islamic
       convert the JDN 1948439.5 to the Islamic Calendar date 01-01-0001:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: year is 0 instead of 1
      + expected - actual

      -0
      +1

      at checkCalendarDate (dist/test/UnitTests.js:33:12)
      at Context.<anonymous> (dist/test/UnitTests.js:591:9)
      at processImmediate (internal/timers.js:443:21)

  12) JDN to Islamic
       convert the JDN 2058044.5 to the Islamic Calendar date 18-04-0310:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 17 instead of 18
      + expected - actual

      -17
      +18

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:606:9)
      at processImmediate (internal/timers.js:443:21)

  13) JDN to Islamic
       convert the JDN 2094600.5 to the Islamic Calendar date 15-06-0413:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 14 instead of 15
      + expected - actual

      -14
      +15

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:611:9)
      at processImmediate (internal/timers.js:443:21)

  14) JDN to Islamic
       convert the JDN 2204108.5 to the Islamic Calendar date 24-06-0722:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 23 instead of 24
      + expected - actual

      -23
      +24

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:626:9)
      at processImmediate (internal/timers.js:443:21)

  15) JDN to Islamic
       convert the JDN 2423373.5 to the Islamic Calendar date 25-03-1341:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 24 instead of 25
      + expected - actual

      -24
      +25

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:656:9)
      at processImmediate (internal/timers.js:443:21)

  16) JDN to Islamic
       convert the JDN 2451481.5 to the Islamic Calendar date 20-07-1420:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 19 instead of 20
      + expected - actual

      -19
      +20

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:661:9)
      at processImmediate (internal/timers.js:443:21)

  17) Conversions from JDN to Gregorian and Julian calendar and in between conversions
       convert an Islamic date into a Gregorian date:

      AssertionError [ERR_ASSERTION]: calendar date is wrong: day is 16 instead of 17
      + expected - actual

      -16
      +17

      at checkCalendarDate (dist/test/UnitTests.js:35:12)
      at Context.<anonymous> (dist/test/UnitTests.js:835:9)
      at processImmediate (internal/timers.js:443:21)
tobiasschweizer commented 5 years ago

@gautschr Great, thanks!