Prefix numbers with zeros in formatDate function