improve handling of change event for datepicker.