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

Fixing bugs with dynamically change enabled dates #125

Merged
merged 1 commit into from
Sep 19, 2018
Merged

Fixing bugs with dynamically change enabled dates #125

merged 1 commit into from
Sep 19, 2018

Conversation

mckey
Copy link
Contributor

@mckey mckey commented Sep 19, 2018

No description provided.

@stefangabos
Copy link
Owner

Please provide some more information about what this is about. What was the issue, how to reproduce it and what the fix does. Thank you!

@mckey
Copy link
Contributor Author

mckey commented Sep 19, 2018

Issue was in dynamically changes of enabled_dates property.

Example:

$('input.datepicker').Zebra_DatePicker({
   direction: true
});

Everything is good.

var datepicker = form.find('.datepicker').data('Zebra_DatePicker');
      datepicker.update({
        disabled_dates: ['* * * *'],
        enabled_dates: prepared_dates,
        custom_classes: {'avail': prepared_dates},
        direction: 0
      });

Still good.

     datepicker.update({
        disabled_dates: false,
        enabled_dates: false,
        custom_classes: false,
        direction: true,
      });

This will fail, due to 'disabled_dates' and 'enabled_dates' (private properties) are not empty. So i added lines 643/644.

Changes to line 914 should be clear to you - disabled_dates[interval][0] is array, not string value.

@stefangabos stefangabos merged commit 4dabdbf into stefangabos:master Sep 19, 2018
@stefangabos
Copy link
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants