Refactored and wrote a some tests for empty date formatting.