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

Not able to disable dates dynamically. #326

Open
Nayank9 opened this issue Apr 10, 2021 · 1 comment
Open

Not able to disable dates dynamically. #326

Nayank9 opened this issue Apr 10, 2021 · 1 comment

Comments

@Nayank9
Copy link

Nayank9 commented Apr 10, 2021

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
@F-E-N-R-I-R
Copy link

F-E-N-R-I-R commented Apr 14, 2021

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,
    }],
};

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