Fixes #763: handling empty string for date formatting.