added unit test for formatDate