ion2-calendar
ion2-calendar copied to clipboard
Not able to disable dates dynamically.
Ionic version: (check one with "x") [ ] 2.x [ ] 3.x [x ] 4.x
Ion2-calendar mode: (check one with "x") [ ] components mode [x ] modal mode
I'm submitting a ... (check one with "x") [ ] bug report [ ] feature request [x ] help me
Current behavior:
I'm trying to disable some dates dynamically but it's not working, it is disabling dates only when we set disable dates at the time of variable initialisation. -----------Following is Working---------------- options: CalendarModalOptions = { daysConfig: [ { date: new Date(2021, 3, 12), disable: true, }, { date: new Date(2021, 3, 15), disable: true, } ] }; -----------Not Working--------------- this.options.daysConfig = [{ date: new Date(2021, 3, 12), disable: true, }, { date: new Date(2021, 3, 15), disable: true, }];
Expected behavior:
Steps to reproduce:
Related code:
insert short code snippets here
Other information:
Ionic info: (run ionic info
from a terminal/cmd prompt and paste output below):
insert the output from ionic info here
You can try to replace whole options, works for me, smth like -
this.options = {
...this.options,
daysConfig: [{
date: new Date(2021, 3, 12),
disable: true,
}, {
date: new Date(2021, 3, 15),
disable: true,
}],
};