Open JoanJosep33 opened 6 years ago
Hi, this is how I did it:
loadEvents() {
let eventsSource: DayConfig[] = [];
this.calendarService.getEvents()
.subscribe(response => {
response.forEach(event => {
eventsSource.push({
date: event.startTime,
marked: true,
subTitle: event.numEvents < 5 ? "*".repeat(event.numEvents) : "****"
});
});
this.options = {
...this.options,
daysConfig: eventsSource
};
});
}
Hello @aam-antonio . First, thank you for your response. I have some doubts, what is the calendarService, do u have a Service, or its a component from the Calendar library?
Thank you so much!
From the beginning, what you want to do is mark days?
Yes, but if I change the month and come back, I lost the days markeds.
Maybe on the monthChange event you are cleaning the daysConfig array.
Can you show your code?
There is a defect in marked flag, randomly automatically few days marked is coming as true. The values I set in the daysConfig is not getting reflected in Calendar.
Ionic version: (check one with "x") [ ] 2.x [X ] 3.x [ ] 4.x
Ion2-calendar mode: (check one with "x") [X ] components mode [ ] modal mode
I'm submitting a ... (check one with "x") [ ] bug report [ ] feature request [X ] help me
Current behavior: Hi, I am not able to add a days from the controller into the calendar on the view. It just added when I click on some day on the calendar.
Expected behavior: How can I load the new days addeds on the array on the controller? I know there is a ViewChild, but which method can I achieve this?