Set datepicker correctly on edit.