update date only when a valid date is given