lilcodelab / Xamarin.Plugin.Calendar

Calendar plugin for Xamarin.Forms
MIT License
260 stars 60 forks source link

[Bug] Event indicator not showing #11

Closed nxhartwig closed 5 years ago

nxhartwig commented 5 years ago

I have the problem that the event indicator is not showing on some special days. To reproduce start the calendar in june add some events for june and one for new DateTime(2019, 5, 27). The 27. May will be shown but when i switch the month to may the event indicator is gone...

june mai

PenguinPero commented 5 years ago

I will take a look into it tonight :)

PenguinPero commented 5 years ago

For me it is working fine

photo_2019-06-11_20-20-48 photo_2019-06-11_20-20-48 (2)

This is the code in my VM: image

Could you maybe give me more details Did you use something other than Add or indexer to insert items to EventCollection? Which CultureInfo are you using? Or maybe simple reproduction project?

PenguinPero commented 5 years ago

I see that it is an iOS screenshot? Did you take the screenshot on simulator or device?

Cause simulators can often be buggy and not refresh the UI

nxhartwig commented 5 years ago

I read the events only for one month. When the month is changed new events will be read from the server and added with Events.Add to the collection.

But i have solved my problem by now. It was a dumb mistake with the height of the calendar. I'am very sorry for that. After fixing that problem i also had a problem refreshing the ui. Now i add the events with a delay and it works fine.

await Task.Delay(100).ContinueWith(_ => { context.Events.Add(rowDay.dtDate, new List()); }, TaskScheduler.FromCurrentSynchronizationContext());

Thank you for your help and sorry for taking your time.

PenguinPero commented 5 years ago

hmm Events.Add should refresh the calendar, I mean call the LoadDays on MonthDaysView* I see that you closed the issue, but is this calendar's fault? Should you be doing workarounds or should I fix it somehow?

EDIT: *There was a fix, I don't know which version exactly, where I added UI notifications for Events.Add and Events[] =... , so that when you add new events it should update the UI