Fix occasional invalid date formatting

(Embarrassing javascript typing bug)