diff --git a/persian-calendar@iamrezamousavi.gmail.com/hijriDate.js b/persian-calendar@iamrezamousavi.gmail.com/hijriDate.js index bfaf552..92da543 100644 --- a/persian-calendar@iamrezamousavi.gmail.com/hijriDate.js +++ b/persian-calendar@iamrezamousavi.gmail.com/hijriDate.js @@ -1,4 +1,5 @@ -/* eslint-disable */ +/* eslint no-use-before-define: "off", no-param-reassign: "off" */ + /* * https://github.com/SCR-IR/tarikh-npm */ @@ -66,7 +67,6 @@ function _julianDayToGregorian(julianDay) { for (gM = 0; gM < 13 && gD > gDoM[gM]; gM++) gD -= gDoM[gM]; - return [gY, gM, gD]; } @@ -85,7 +85,6 @@ function _julianDayToHijriA(julianDay) { if (im > 12) im = 12; - id = 1 + tmp - ~~((29.5 * (im - 1)) + 0.5); return [iy, im, id]; } @@ -104,7 +103,6 @@ function _hijriToJulianDay(iY, iM, iD) { for (let m = 1; m < iM; m++) julianDay += HILAL.iDoM[iY][m]; - break; } } @@ -127,7 +125,6 @@ function _julianDayToHijri(julianDay) { for (iM = 1; iM < 13 && iD > HILAL.iDoM[iY][iM]; iM++) iD -= HILAL.iDoM[iY][iM]; - break; } } @@ -137,12 +134,13 @@ function _julianDayToHijri(julianDay) { function _hilalIM(country = 'IR') { return { + // https://github.com/ilius/starcal/blob/master/scal3/cal_types/hijri-monthes.json IR: { startYear: 1427, /* =iDoM:firstYear */ startJD: 2453767, /* =_hijriAToJulianDay(startYear,1,1) */ - endYear: 1445, /* =iDoM:lastYear */ - endJD: 2460499, /* =_hijriAToJulianDay(endYear+1,1,1)-1 */ + endYear: 1446, /* =iDoM:lastYear */ + endJD: 2460735, /* =_hijriAToJulianDay(endYear,endMonth+1,1)-1 */ iDoM: { 1427: [355, 30, 29, 29, 30, 29, 30, 30, 30, 30, 29, 29, 30], @@ -163,7 +161,8 @@ function _hilalIM(country = 'IR') { 1442: [354, 29, 29, 30, 29, 30, 29, 30, 30, 29, 30, 30, 29], 1443: [354, 29, 30, 30, 29, 29, 30, 29, 30, 30, 29, 30, 29], 1444: [354, 30, 30, 29, 30, 29, 29, 30, 29, 30, 29, 30, 29], - 1445: [355/* |354*/, 30, 30, 30, 29, 30, 29, 29, 30, 30, 29, 30, 29/* |30 :Delta*/], + 1445: [354, 30, 30, 30, 29, 30, 29, 29, 30, 29, 30, 29, 29], + 1446: [238, 30, 30, 30, 29, 30, 30, 29, 30], /* Delta = endJD - _hijriAToJulianDay(endYear,12,29) */