Skip to content
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

Script hangs on certain combinations of min and disabled #388

Closed
peramikic opened this issue Apr 5, 2014 · 1 comment
Closed

Script hangs on certain combinations of min and disabled #388

peramikic opened this issue Apr 5, 2014 · 1 comment
Labels
Milestone

Comments

@peramikic
Copy link

I am trying to disable Saturdays and Sundays and set a min date to today.
The issue occurs when both a min date falls on either Saturday or Sunday in which case the script hangs the page load and pops the browser usage to max.
These parameters will reproduce the issue

min: [2014,3,12], //Saturday
disable: [1,7],

Individually there is no problem with either or when the min date falls outside the disable range. Is there a way to achieve this with only 'disable', I have not found a way to pass days of week and range

@peramikic
Copy link
Author

Since I could not track down where the loop happens, the workaround I did was to prescreen the value for min and eliminate it falling on a weekend with something like this

var minDate = new Date();
var day = minDate.getDay(); 
if (day == 6)  // Saturday
{
    minDate.setDate(minDate.getDate() + 2);
} else if (day == 0)  // Sunday
{
    minDate.setDate(minDate.getDate() + 1);
}

The script advances the date to Mon in case today is Sat or Sun.
the just set min: minDate

@amsul amsul added the todo label Apr 11, 2014
@amsul amsul added this to the v3.4.1 milestone Apr 11, 2014
@amsul amsul added the bug label Apr 11, 2014
amsul added a commit that referenced this issue Apr 12, 2014
also cleaned erroneous whitespace
@amsul amsul added solved and removed todo labels Apr 12, 2014
@amsul amsul closed this as completed Apr 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants