Better solution for autoCloseOnSelectDate