Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Help] Bug in Robins LazyCalendar

Hi all, I just started to use Robins LazyCalendar script. It looks like there are some minor bugs, but Robin seems to be inactive at this time. Soo... could someone more proficient in js than me have a look at it, please? In particular in the main menu there is a set_month button, which throws an error and stops the api. RangeError: Maximum call stack size exceeded RangeError: Maximum call stack size exceeded at getMonth (apiscript.js:11723:16) at setCurrentDoM (apiscript.js:11655:30) at setCurrentDoM (apiscript.js:11663:13) at setCurrentDoM (apiscript.js:11663:13) at setCurrentDoM (apiscript.js:11663:13) at setCurrentDoM (apiscript.js:11663:13) at setCurrentDoM (apiscript.js:11663:13) at setCurrentDoM (apiscript.js:11663:13) at setCurrentDoM (apiscript.js:11663:13) at setCurrentDoM (apiscript.js:11663:13) In the meantime I advance the month as many times as needed and don't touch the set_month. But that's a workaround and it would be neat if the button would work. If anyone as an idea, I'd appreciate it. Kind regards Danii
1593207244
The Aaron
Roll20 Production Team
API Scripter
my guess is that it thinks one of your months has 0 days in it, so when it recurses on days-month.days, it is always the same number.  I don't know much about that script, so it's hard to say how to fix it other than to suggest checking that your calendar is configured correctly.
Hi Aaron, thanks for your answer! I checked the length of my months. None is 0, but one is 5 (on purpose). Maybe that throws it off. The calculation of the weekday also only works with gregorian calendar (hardcoded). Had to rewrite that function for my custom calendar. So maybe there is something hardcoded somewhere it shouldn't be. Any other thoughts still appreciated. ;)
1593212978

Edited 1593212985
The Aaron
Roll20 Production Team
API Scripter
You should post a gist of your changed code, if you're able.  That would help with the debugging.
The code was changed after the bug first appeared, so it's definitly not the cause. It's in an unrelated function and does not change the range of values which are returned. I can't post it because it contains copyrighted data (i.e. the formula of how weekdays are calculated in this specific gamesystem).
1593213770
The Aaron
Roll20 Production Team
API Scripter
No worries!  If you want to PM me an invite and GM me, I can probably sort it out. 
1593362030

Edited 1593362052
Bug fixed. Some functions were expecting int but got string-arguments in the calls. parseInt() fixed it.
1593362388
The Aaron
Roll20 Production Team
API Scripter
Ah!  Fantastic!