Fixed JS date-prettifier to account for inconsistent getDate() and getMonth() methods in JavaScript