[fix bug 968077] Fix 500 error caused by empty datefield.