Bugfix: Script error when date field is empty

Clearing a date field caused a script error.