Add custom event listeners for showing and hideing datepicker