change open/close method for datepicker