Fixes issue when submitting an empty string as a date.