https://github.com/hsuanxyz/ion2-calendar/issues/241
Here it is written as
you can change the default date color by pushing the days to daysConfig and passing dayConfig: { marked: true} and then you can change the color with .marked class css and also you can pass with the 'cssClass' key
daysConfig.push({
date: new Date(item),
marked: true
});
DayConfig {
date: Date;
marked?: boolean;
disable?: boolean;
title?: string;
subTitle?: string;
cssClass?: string;
}
here's the interface of daysConfig
When i tried like this
options: CalendarComponentOptions = {
from: new Date(2000, 0, 1),
pickMode: 'multi',
daysConfig: [
{
date:new Date(this.absentdate[0]),
marked:true,
cssClass: 'my-cal'
},
{
date:new Date(this.absentdate[1]),
cssClass:'my-cal',
marked:true
},
{
date:new Date(this.absentdate[2]),
cssClass:'my-cal',
marked:true
}
],
};
it worked
But i have an array of absent_date as
absentdate :string[]=['2020-01-03', '2020-01-04', '2020-01-28'];
which keeps on varying according to the month.How can i change the hardcoded value to the absent dates that i have given in the array.Please help me.
T Template ::
<ion-calendar [(ngModel)]="date"
(change)="onChange($event)"
[options]="options"
type="string"
format="YYYY-MM-DD"
readonly="true"
>
</ion-calendar>
daysConfiglength based on?