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

Using update() to change custom_classes not working? #104

Closed
jafin opened this issue Dec 13, 2017 · 3 comments
Closed

Using update() to change custom_classes not working? #104

jafin opened this issue Dec 13, 2017 · 3 comments

Comments

@jafin
Copy link

jafin commented Dec 13, 2017

Attempting to use update() to refresh which dates a custom class should be applied. Using something similar to:

calendar().update({custom_classes: {'bookingCalendar--week1': ['5 12 2017']}});

The prop is being set in the custom settings, but the UI does not reflect the change.

@stefangabos
Copy link
Owner

I can't confirm this.
Open the examples, open the console and paste this in the console

$('#datepicker').data('Zebra_DatePicker').update({custom_classes: {'test': ['30 12 2017']}});

Now open the first example and inspect day 30 of December 2017. You will see the class test was added

@jafin
Copy link
Author

jafin commented Dec 20, 2017

Thanks, using your example:

If the date picker is open and you run
$('#datepicker').data('Zebra_DatePicker').update({custom_classes: {'test': ['30 12 2017']}});
It does not appear to add the class until it is reopened.

If you then run a second time (picker is either shut or open)
$('#datepicker').data('Zebra_DatePicker').update({custom_classes: {'test2': ['30 12 2017']}});
then it does not appear to update the class to 'test2', and still shows 'test' as the class.

stefangabos added a commit that referenced this issue Apr 8, 2018
@stefangabos
Copy link
Owner

Could not reproduce the first issue. As long as you set the precedence correctly for your CSS (i.e. .Zebra_DatePicker .dp_body td.test) the CSS properties are being applied.

Also, I fixed second issue, the one where subsequent custom classes were not being applied after one custom class was already applied. 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

No branches or pull requests

2 participants