Add formatDate and test