Safari Date constructor does not accept YYYY-mm-dd argument; so add a parseDate function that splits the date into Y,m,d