
Kevin Brammer did a great job some time ago to fix this, however - and with the greatest of respect - I thought I could improve upon his code and use the Flex component lifecycle framework to bind his ExtendedDateChooser to an array collection of events.
So, here's my version. The dateCollection is a collection of objects that have the properties color, date and narrative (although if your objects don't use those property names, you can change the colorField, dateField and narrativeField of the component).
When either the collection changes or invalidateDisplayList() is invoked, the addEvents() method loops over the collection and sets the background and foreground colors of the individual UITextFields that make up the CalendarLayout. I also check the luminosity of the background color and set the foreground to ensure it's readable.
The data grid on the right displays the contents of the events collection and in this demo you can add and remove events.
The real meat lives here and the rest of the source code is here.
One little post script - the renderer only displays one event per date. Multiple events per date are for version 2 :)
View comments