hebcal / hebcal-js

⛔️ DEPRECATED - a perpetual Jewish Calendar (JavaScript)
GNU General Public License v3.0
123 stars 40 forks source link

RangeError When Year is 3765 #84

Open HeyITGuyFixIt opened 3 years ago

HeyITGuyFixIt commented 3 years ago

I get this error when I create an instance of Hebcal with the year 3765:

Uncaught RangeError: Maximum call stack size exceeded
    at i (hebcal.min.js:formatted:1148)
    at a (hebcal.min.js:formatted:1146)
    at i (hebcal.min.js:formatted:1152)
    at a (hebcal.min.js:formatted:1146)
    at i (hebcal.min.js:formatted:1152)
    at a (hebcal.min.js:formatted:1146)
    at i (hebcal.min.js:formatted:1152)
    at a (hebcal.min.js:formatted:1146)
    at i (hebcal.min.js:formatted:1152)
    at a (hebcal.min.js:formatted:1146)

I am checking it like this:

new Hebcal(3768);

I am using hebcal.min.js from the master branch, which is up-to-date as of today.

HeyITGuyFixIt commented 3 years ago

It also happens on 3777 and 3793.

HeyITGuyFixIt commented 3 years ago

I looped through every year from year 0 to 6000, and found that this only occurs on years 3765, 3777, 3793, 3805, 3821, and 3833.

mjradwin commented 3 years ago

You might have better luck with @hebcal/core instead of hebcal

It has a similar API but not identical. You can see an example of how you might use the API here:

https://codepen.io/mjradwin/pen/bGwYXMy