Instead of repeating the parsing, I've added an optional `localize` parameter to the parseDate function.