added option 'autoHide' for closing a datepicker if a date is chosen