Event handler when a cell is clicked to select a date