-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite loop when no enabled dates in current year #171
Comments
can you please post how the |
I used |
Sorry, I meant to state that in my original post. I am disabling all dates by default ( |
ok, then what are you using for |
just post the values you are using to create the date picker |
var enabledDates = ["31 12 2020 1-5","2 1 2021 1-5","3 1 2021 1-5","4 1 2021 1-5","5 1 2021 1-5","6 1 2021 1-5","7 1 2021 1-5"]; $('#calendar_collectiondate').Zebra_DatePicker({ |
ok, i was able to reproduce it by removing |
Ahh yes, sorry - that date gets removed through some other code and I neglected to remove it from the example. Great plugin by the way, thank you for it :) |
Should be fixed now. Do you want me to do a new release so you can grab it via npm? |
Our current fix is adequate for now, assuming what I suggested in the original post is satisfactory. We could probably upgrade to the latest version but it would require some testing which I won't be doing on New Years Eve haha. Thanks for the speedy fix! |
i haven't looked at the solution you provided until now, but that is exactly what the solution was (only also needed at a different place). thanks a lot for the feedback and a happy new year! |
We found an issue whereby is_disabled was always returning true, resulting in an infinite loop and hanging our site. It is only caused when there are no enabled dates left in the current year, and the only enabled days are in January of the next month before the current day number (so in our case, only December 31st was affected).
We are using v1.9.0 and the resolution was to add the following code after line 772 (after "
first_selectable_month = 11;
"):first_selectable_day = new Date(first_selectable_year, first_selectable_month + 1, 0).getDate();
and also this code after line 781 ("
first_selectable_month = 0;
"):first_selectable_day = 1;
I believe the latest version (v1.9.17) is still affected but that's minified so I can't tell you how to change that, sorry.
Hope that helps someone out.
The text was updated successfully, but these errors were encountered: