Add fix to hide datepicker

Fix to hide the datepicker if the modal is closed using the "x" button of the top bar