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

How to setDisabledDates when event "onshow" is fired? #2654

Open
ancuriskey2000 opened this issue Mar 23, 2022 · 0 comments
Open

How to setDisabledDates when event "onshow" is fired? #2654

ancuriskey2000 opened this issue Mar 23, 2022 · 0 comments

Comments

@ancuriskey2000
Copy link

ancuriskey2000 commented Mar 23, 2022

Expected behaviour

If I'm doing it correctly, the disabled dates should be rerendered.

Actual behaviour

"Uncaught TypeError: this.setDatesDisabled is not a function" error is shown on Chrome Console.

Datepicker version used

Datepicker for Bootstrap v1.9.0

Example code

$(self.template.querySelector('.datepicker')).datepicker({
            format: 'dd/mm/yyyy',
            startDate: new Date(),
            endDate: finalDate,
            datesDisabled: disabledDates,
            ignoreReadonly: true

        }).on('show', function (selected) {
            self.setDatesDisabled(['10/04/2022'])

        }).on('changeDate', function (selected) {
            self.selectedDate = selected.target.value;
            let dateval = self.selectedDate;
            const selectedEvent = new CustomEvent("datechange", {
                    detail: dateval
                });
            self.dispatchEvent(selectedEvent);
        });
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

1 participant