# Unselect a selected event in a Month View component

**URL:** <https://forum.inductiveautomation.com/t/unselect-a-selected-event-in-a-month-view-component/9353>\
**Category:** Ignition\
**Created:** [November 18, 2014, 5:22pm UTC](https://forum.inductiveautomation.com/t/unselect-a-selected-event-in-a-month-view-component/9353 "2014-11-18T17:22:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amarth](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarth/32/3313_2.png) [@Amarth](https://forum.inductiveautomation.com/u/Amarth)\
**Post date:** [November 18, 2014, 5:22pm UTC](https://forum.inductiveautomation.com/t/unselect-a-selected-event-in-a-month-view-component/9353/1 "2014-11-18T17:22:36Z")

</div>

Hello,

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.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 18, 2014, 6:25pm UTC](https://forum.inductiveautomation.com/t/unselect-a-selected-event-in-a-month-view-component/9353/2 "2014-11-18T18:25:23Z")

</div>

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
    `

---

<div class="post-metadata">

**Author:** ![Amarth](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarth/32/3313_2.png) [@Amarth](https://forum.inductiveautomation.com/u/Amarth)\
**Post date:** [November 19, 2014, 9:02am UTC](https://forum.inductiveautomation.com/t/unselect-a-selected-event-in-a-month-view-component/9353/3 "2014-11-19T09:02:06Z")

</div>

That did the trick. Thank you very much.
