Fix UDF date formatting

Fixes #1046
It looks like ``udf_def`` could have a value of ``None``. I think this would only happen in the case of malformed data so we may want to throw a meaningful exception with the field details to aid in debugging.