Unselect a selected event in a Month View component


Is there a way to unselect the currentely selected event in a Month View component when clicking on an eventless day ?
I tried to make a script on change of the selectedDay property but I cannot think of an easy way to determine if the new selectedDay is eventless (except browsing the events dataset and trying to determine if the selected day is not between the startDate and endDate of an event)

Are there unexposed properties or events I could use to ease the unselection ?

Thank you.

I tried this in a propertyChange script. Seems to work okay.

EDIT: Forgot to mention “Adding a custom property called ‘PrevEvent’. Sorry for any confusion.”

if event.propertyName=="selectedDay": if event.source.selectedEvent==event.source.PrevEvent: event.source.selectedEvent=-1 event.source.PrevEvent=-1 else: event.source.PrevEvent=event.source.selectedEvent

That did the trick. Thank you very much.