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

Handle form-control disable state changes #98

Closed
wants to merge 1 commit into from
Closed

Handle form-control disable state changes #98

wants to merge 1 commit into from

Conversation

Ksisu
Copy link

@Ksisu Ksisu commented Mar 30, 2021

@CrackerakiUA
Copy link

CrackerakiUA commented Apr 19, 2021

Any luck on this? I need this feature :)
Is this the case when we need to change disabled dates on calendar?

@Ksisu
Copy link
Author

Ksisu commented Apr 19, 2021

This is not that case. It's when you want to disable the whole input field.


If you want change the disabled dates after initialization, you can use a function in the config. Like:

disabledDates: string[] = ['2021-04-19'];
flatpickrConfig: FlatpickrOptions = {disable: [ (date) => this.disabledDates.includes(date.toISOString().substr(0, 10)) ]}

changeTheDisabledDates() {
  this.disabledDates.push("2021-04-20");
}
<ng2-flatpickr [config]="flatpickrConfig"></ng2-flatpickr>

@gopukinapp
Copy link

how to disable the entire ng2-flatpickr any guess?...

This pull request was closed.
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

3 participants