moved formatDate function to a more generic utils module