issue 2566 check for nil in set date functions on work model

ref https://code.google.com/p/otwarchive/issues/detail?id=2566